问:
Nextjs next-authjs production issue client_fetch_error invalid json response body at http://127.0.0.1:3000/api/auth/session
I have implemented Nextjs next-authjs with google.

On production i am facing this issue.

```<code>umesh.bhat@mcs:/var/mcs/test/gui-mcs-front-end$ npm run dev

> mcs-front-end@1.1.0 dev /var/mcs/test/gui-mcs-front-end
> next

SyntaxError: Invalid or unexpected token
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/var/mcs/test/gui-mcs-front-end/node_modules/openid-client/lib/index.js:1:16)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
error - /var/mcs/test/gui-mcs-front-end/node_modules/openid-client/lib/issuer.js:32
  #metadata;

I think the issue is related to NEXTAUTH_URL in env but i am not able to resolve that issue.
</code>```

Body:
I have implemented Nextjs next-authjs with google.

On production i am facing this issue.

umesh.bhat@mcs:/var/mcs/test/gui-mcs-front-end$ npm run dev

> mcs-front-end@1.1.0 dev /var/mcs/test/gui-mcs-front-end
> next

SyntaxError: Invalid or unexpected token
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/var/mcs/test/gui-mcs-front-end/node_modules/openid-client/lib/index.js:1:16)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
error - /var/mcs/test/gui-mcs-front-end/node_modules/openid-client/lib/issuer.js:32
  #metadata;

I think the issue is related to NEXTAUTH_URL in env but i am not able to resolve that issue.


来源: stackexchange

问:
Keras pretrained model reset accuracy after unfreezing
Pretty simple code:

```<code>feature_extractor = K.application...
classifier = K.Sequential(...)

# just a class that should augment the training set
class DataAugmentationModel(K.models.Model):
    def __init__(self, preprocess, feature_extractor, classifier, train_feature_extractor=False, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.preprocess = preprocess
        self.classifier = classifier
        self.feature_extractor = feature_extractor
        with tf.device("/cpu:0"):
            self.rotate = K.layers.RandomRotation((-.5, .5))
            self.flip = K.layers.RandomFlip("horizontal")
            self.zoom = K.layers.RandomZoom((-.5,.1), fill_mode="nearest")
            self.brightness = K.layers.RandomBrightness(.5)
            self.contrast = K.layers.RandomContrast(.5)
            self.g_noise = K.layers.GaussianNoise(2.)

        self.acc = K.metrics.SparseCategoricalAccuracy()
        self.loss_tracker = K.metrics.Mean()
        self.test_acc = K.metrics.SparseCategoricalAccuracy()
        self.cls_opt = K.optimizers.Adam()
        self.fe_opt = K.optimizers.Adam()
        self.train_feature_extractor = train_feature_extractor
    def train_step(self, data):
        x,y = data
        x = self.preprocess(x)
        x = self.rotate(x)
        x = self.flip(x)
        x = self.zoom(x)
        x = self.brightness(x)
        x = self.contrast(x)
        x = self.g_noise(x)

        with tf.GradientTape(persistent=True) as tape:
            feature = self.feature_extractor(x, training=self.train_feature_extractor)
            pred = self.classifier(feature)
            pred_loss = tf.reduce_mean(tf.losses.sparse_categorical_crossentropy(y, pred))
            loss = pred_loss

        classifier_grads = tape.gradient(loss, self.classifier.trainable_weights)
        self.cls_opt.apply_gradients(zip(classifier_grads, self.classifier.trainable_weights))

        if self.train_feature_extractor:
            feature_extractor_grads = tape.gradient(loss, self.feature_extractor.trainable_weights)
            self.fe_opt.apply_gradients(zip(feature_extractor_grads, self.feature_extractor.trainable_weights))

        self.loss_tracker.update_state(loss)
        self.acc.update_state(y, pred)
        return {
            "loss" : self.loss_tracker.result(),
            "acc": self.acc.result()
        }

    def test_step(self, data):
        x,y = data
        x = self.preprocess(x)
        pred = self.classifier(self.feature_extractor(x))
        loss = self.loss(y, pred)
        acc = self.test_acc(y, pred)
        return {
            "loss" : loss,
            "acc": acc
        }
</code>```

my training code:

```<code># train just the final layers of the classifiers and not the pretrained
data_model = DataAugmentationModel(K.applications.resnet50.preprocess_input, feature_extractor, classifier, train_feature_extractor=False)
data_model.compile(K.optimizers.Adam(5e-5), loss=K.losses.SparseCategoricalCrossentropy(), metrics=[K.metrics.SparseCategoricalAccuracy()])
data_model.fit(X_train, y_train, validation_data=(X_validation, y_validation), batch_size=512, epochs=10)
# last output:
# 98/98 [==============================] - 10s 100ms/step - loss: 1.8044 - acc: 0.3530 - val_loss: 1.8396 - val_acc: 0.3635
</code>```

then:

```data_model.train_feature_extractor = True
data_model.compile(K.optimizers.Adam(1e-5), loss=K.losses.SparseCategoricalCrossentropy(), metrics=[K.metrics.SparseCategoricalAccuracy()])
data_model.fit(X_train, y_train, validation_data=(X_validation, y_validation), batch_size=512, epochs=20)
# first output
# 5/98 [>.............................] - ETA: 57s - loss: 6.8106 - acc: 0.1249
```

Why does it resets this brutally the accuracy?

ContentLicense: CC BY-SA 4.0

Body:
Pretty simple code:

feature_extractor = K.application...
classifier = K.Sequential(...)

# just a class that should augment the training set
class DataAugmentationModel(K.models.Model):
    def __init__(self, preprocess, feature_extractor, classifier, train_feature_extractor=False, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.preprocess = preprocess
        self.classifier = classifier
        self.feature_extractor = feature_extractor
        with tf.device("/cpu:0"):
            self.rotate = K.layers.RandomRotation((-.5, .5))
            self.flip = K.layers.RandomFlip("horizontal")
            self.zoom = K.layers.RandomZoom((-.5,.1), fill_mode="nearest")
            self.brightness = K.layers.RandomBrightness(.5)
            self.contrast = K.layers.RandomContrast(.5)
            self.g_noise = K.layers.GaussianNoise(2.)

        self.acc = K.metrics.SparseCategoricalAccuracy()
        self.loss_tracker = K.metrics.Mean()
        self.test_acc = K.metrics.SparseCategoricalAccuracy()
        self.cls_opt = K.optimizers.Adam()
        self.fe_opt = K.optimizers.Adam()
        self.train_feature_extractor = train_feature_extractor
    def train_step(self, data):
        x,y = data
        x = self.preprocess(x)
        x = self.rotate(x)
        x = self.flip(x)
        x = self.zoom(x)
        x = self.brightness(x)
        x = self.contrast(x)
        x = self.g_noise(x)

        with tf.GradientTape(persistent=True) as tape:
            feature = self.feature_extractor(x, training=self.train_feature_extractor)
            pred = self.classifier(feature)
            pred_loss = tf.reduce_mean(tf.losses.sparse_categorical_crossentropy(y, pred))
            loss = pred_loss

        classifier_grads = tape.gradient(loss, self.classifier.trainable_weights)
        self.cls_opt.apply_gradients(zip(classifier_grads, self.classifier.trainable_weights))

        if self.train_feature_extractor:
            feature_extractor_grads = tape.gradient(loss, self.feature_extractor.trainable_weights)
            self.fe_opt.apply_gradients(zip(feature_extractor_grads, self.feature_extractor.trainable_weights))

        self.loss_tracker.update_state(loss)
        self.acc.update_state(y, pred)
        return {
            "loss" : self.loss_tracker.result(),
            "acc": self.acc.result()
        }

    def test_step(self, data):
        x,y = data
        x = self.preprocess(x)
        pred = self.classifier(self.feature_extractor(x))
        loss = self.loss(y, pred)
        acc = self.test_acc(y, pred)
        return {
            "loss" : loss,
            "acc": acc
        }

my training code:

# train just the final layers of the classifiers and not the pretrained
data_model = DataAugmentationModel(K.applications.resnet50.preprocess_input, feature_extractor, classifier, train_feature_extractor=False)
data_model.compile(K.optimizers.Adam(5e-5), loss=K.losses.SparseCategoricalCrossentropy(), metrics=[K.metrics.SparseCategoricalAccuracy()])
data_model.fit(X_train, y_train, validation_data=(X_validation, y_validation), batch_size=512, epochs=10)
# last output:
# 98/98 [==============================] - 10s 100ms/step - loss: 1.8044 - acc: 0.3530 - val_loss: 1.8396 - val_acc: 0.3635

then:

data_model.train_feature_extractor = True
data_model.compile(K.optimizers.Adam(1e-5), loss=K.losses.SparseCategoricalCrossentropy(), metrics=[K.metrics.SparseCategoricalAccuracy()])
data_model.fit(X_train, y_train, validation_data=(X_validation, y_validation), batch_size=512, epochs=20)
# first output
# 5/98 [>.............................] - ETA: 57s - loss: 6.8106 - acc: 0.1249

Why does it resets this brutally the accuracy?


问:
CupertinoSlidingSegmentedControl inside SingleChildScrollView not scrolling
I am building in Flutter a custom Segmented Control that has too many options, so it should be scrolled horizontally to see all the options. That is the reason why I put the CupertinoSlidingSegmentedControl inside a SingleChildScrollView with horizontal scrollDirection.

In the Android emulator works ok and scrolls, but on the ios emulator it doesn't scroll.

I don't know what am I doing wrong.

I share the code:

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

class CustomSegmentedControl extends StatefulWidget {
  const CustomSegmentedControl({Key? key}) : super(key: key);

  @override
  State<CustomSegmentedControl> createState() => _CustomSegmentedControlState();
}

class _CustomSegmentedControlState extends State<CustomSegmentedControl> {
  // Por defecto le damos el valor de "todos".
  int? groupValue = 0;

  @override
  Widget build(BuildContext context) {
    return SingleChildScrollView(
      scrollDirection: Axis.horizontal,
      child: CupertinoSlidingSegmentedControl(
        padding: const EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
        children: const {
          0: Text("Todos"),
          1: Text("2005"),
          2: Text("2006"),
          3: Text("2007"),
          4: Text("2008"),
          5: Text("2009"),
          6: Text("2010"),
          7: Text("2011"),
          8: Text("2012"),
          9: Text("2013"),
        },
        groupValue: groupValue,
        onValueChanged: (value) {
          setState(() {
            groupValue = value;
          });
        },
      ),
    );
  }
}
</code>```

Body:
I am building in Flutter a custom Segmented Control that has too many options, so it should be scrolled horizontally to see all the options. That is the reason why I put the CupertinoSlidingSegmentedControl inside a SingleChildScrollView with horizontal scrollDirection.

In the Android emulator works ok and scrolls, but on the ios emulator it doesn't scroll.

I don't know what am I doing wrong.

I share the code:

import 'package:flutter/cupertino.dart';

class CustomSegmentedControl extends StatefulWidget {
  const CustomSegmentedControl({Key? key}) : super(key: key);

  @override
  State<CustomSegmentedControl> createState() => _CustomSegmentedControlState();
}

class _CustomSegmentedControlState extends State<CustomSegmentedControl> {
  // Por defecto le damos el valor de "todos".
  int? groupValue = 0;

  @override
  Widget build(BuildContext context) {
    return SingleChildScrollView(
      scrollDirection: Axis.horizontal,
      child: CupertinoSlidingSegmentedControl(
        padding: const EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
        children: const {
          0: Text("Todos"),
          1: Text("2005"),
          2: Text("2006"),
          3: Text("2007"),
          4: Text("2008"),
          5: Text("2009"),
          6: Text("2010"),
          7: Text("2011"),
          8: Text("2012"),
          9: Text("2013"),
        },
        groupValue: groupValue,
        onValueChanged: (value) {
          setState(() {
            groupValue = value;
          });
        },
      ),
    );
  }
}


问:
Double Dynamic Measures in PowerBi visual
I am attempting to create a slicer, which would switch between measures in a visual.

Due to some limitations, I'm not using Field parameter. Instead, I'm using a measure name table + DAX expression used as value in visual, meant to switch between measure.

Issue I'm facing:
For some cases, I need to show two measures in a visual, with legend for each measure. If i simply select two measures in slicer, I'm getting a sum of two measures.

Is this possible to achieve?
Current DAX expression two switch between measures:

```<code>Selected Measure =
    IF (
        HASONEVALUE ( 'Measures Table'[Measure] ),
        SWITCH (
            VALUES ( 'Measures Table'[Measure] ),
            "Total", [Total],
            "New", [New] ,
            "Direct", [Direct],
            "Indirect", [Indirect]
        ),
        [Total]
    )
</code>```

How do I combine "Direct" and "Indirect" in one slicer position, to display both measures in visual with legend?

Body:
I am attempting to create a slicer, which would switch between measures in a visual.

Due to some limitations, I'm not using Field parameter. Instead, I'm using a measure name table + DAX expression used as value in visual, meant to switch between measure.

Issue I'm facing:
For some cases, I need to show two measures in a visual, with legend for each measure. If i simply select two measures in slicer, I'm getting a sum of two measures.

Is this possible to achieve?
Current DAX expression two switch between measures:

Selected Measure =
    IF (
        HASONEVALUE ( 'Measures Table'[Measure] ),
        SWITCH (
            VALUES ( 'Measures Table'[Measure] ),
            "Total", [Total],
            "New", [New] ,
            "Direct", [Direct],
            "Indirect", [Indirect]
        ),
        [Total]
    )

How do I combine "Direct" and "Indirect" in one slicer position, to display both measures in visual with legend?


问:
Keras import confusion?
I'm trying to follow along with the code from Saul Dobilas's blog on DCGANs.

I have a Tensorflow-gpu conda environment that I'm running the code from. When I try & run it thought the following error is thrown,

```<code>Traceback (most recent call last):
  File ".\DeepConvGanExample.py", line 10, in <module>
    print('Tensorflow/Keras: %s' % keras.__version__) # print version
  File "C:\ProgramData\Anaconda3\envs\tf-gpu\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 62, in __getattr__
    module = self._load()
  File "C:\ProgramData\Anaconda3\envs\tf-gpu\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 45, in _load
    module = importlib.import_module(self.__name__)
  File "C:\ProgramData\Anaconda3\envs\tf-gpu\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'keras'
</code>```

So I opened up a python interpreter & typed the following lines,

```<code>from tensorflow import keras
keras.__version__
</code>```

And I get a similar traceback,

```<code>Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramData\Anaconda3\envs\tf-gpu\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 62, in __getattr__
    module = self._load()
  File "C:\ProgramData\Anaconda3\envs\tf-gpu\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 45, in _load
    module = importlib.import_module(self.__name__)
  File "C:\ProgramData\Anaconda3\envs\tf-gpu\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'keras'
</code>```

OK so I closed the interpreter & opened a new one & typed,

```<code>import tensorflow.keras as keras
keras.__version__
</code>```

Which gives,

```<code>'2.6.0'
</code>```

What's going on here?

SOLUTION :: I had the wrong version of TensorFlow installed.

Title: Keras import confusion?

Body:
I'm trying to follow along with the code from Saul Dobilas's blog on DCGANs.

I have a Tensorflow-gpu conda environment that I'm running the code from. When I try & run it thought the following error is thrown,

Traceback (most recent call last):
  File ".\DeepConvGanExample.py", line 10, in <module>
    print('Tensorflow/Keras: %s' % keras.__version__) # print version
  File "C:\ProgramData\Anaconda3\envs\tf-gpu\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 62, in __getattr__
    module = self._load()
  File "C:\ProgramData\Anaconda3\envs\tf-gpu\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 45, in _load
    module = importlib.import_module(self.__name__)
  File "C:\ProgramData\Anaconda3\envs\tf-gpu\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'keras'

So I opened up a python interpreter & typed the following lines,

from tensorflow import keras
keras.__version__

And I get a similar traceback,

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramData\Anaconda3\envs\tf-gpu\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 62, in __getattr__
    module = self._load()
  File "C:\ProgramData\Anaconda3\envs\tf-gpu\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 45, in _load
    module = importlib.import_module(self.__name__)
  File "C:\ProgramData\Anaconda3\envs\tf-gpu\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'keras'

OK so I closed the interpreter & opened a new one & typed,

import tensorflow.keras as keras
keras.__version__

Which gives,

'2.6.0'

What's going on here?

SOLUTION :: I had the wrong version of TensorFlow installed.


问:
Access file in vm from GitHub actions
How can I access a file available in a windows vm from GitHub using actions

I am new to GitHub actions and looking for any suggestions and help

Title: Access file in vm from GitHub actions


问:
React Native: If I'm updating targetSdkVersion, should I update anything else?
I'm upgrading the version of React Native OneSignal to 4.8.0, and in the ChangeLog it says change your Android targetSdk to 33. I currently have compileSdkVersion and targetSdkVersion both set to 31.

What I Want To Know:

Should I also set compileSdkVersion to 33?

If I'm updating one of both of these properties, is there anything else in my code that I should update?


问:
Angular margin-top not working as expected
So, i built an app for my Angular project in electron, and it recognizes if ur coming from the app and adds a toolbar, but the UI goes in the toolbar (see the image).

I tried to give a margin to the whole project, but it doesn't work.

Any tips? Thanks!


问:
How to enable multiple proxy managers waiting for user approval event
I have a MacOS network extension that activates 3 network "Proxies" (TransparentProxy, AppProxy and DNSProxy).

To activate the proxies I do:

```<code>NEAppProxyProviderManager.loadAllFromPreferences {
    saveToPreferences { error in
      if (error) {
         /* failed to save */
      }
      /* saved */
    }
}
</code>```

Now I do this 3 times (once for each proxy).
The behavior I observe is the following:

Once the "saveToPreferences()" is called for the first time the app is installed, user gets an approval popup.

Even before user clicks anything, the first 2 calls to "saveToPreferences" fail (both with the same message):

```<code>Failed to save configuration MyTransparentProxy: Error Domain=NEConfigurationErrorDomain Code=10 “permission denied” UserInfo={NSLocalizedDescription=permission denied}
</code>```

The third call to "saveToPreferences()" does NOT return until a user either accepts or rejects the "allow vpn configuration" pop up.

My question is, how can I make all the calls to block the completion callback until user decision ?

For now, I figured out that this works as workaround:
In the initialization of the first proxy I do:

```<code>NEAppProxyProviderManager.loadAllFromPreferences {
    saveToPreferences { error in
      if (error) {
         /* failed to save */
      }
      /* saved */
      /* here I start the “next” proxies */
      StartNextProxy();
    }
}
</code>```

In this case the first one is blocked until user accepts the pop up and once he does I start the second and the third proxies. This ensure avoidance of "permission denied" error as only one "saveToPreferences()" call waits for user approval.

This doesn’t feel like the correct method to me, is there a way for multiple proxy manager to wait for "VPN Configuration" approval event ?

Body:
I have a MacOS network extension that activates 3 network "Proxies" (TransparentProxy, AppProxy and DNSProxy).

To activate the proxies I do:

NEAppProxyProviderManager.loadAllFromPreferences {
    saveToPreferences { error in
      if (error) {
         /* failed to save */
      }
      /* saved */
    }
}

Now I do this 3 times (once for each proxy).
The behavior I observe is the following:

Once the "saveToPreferences()" is called for the first time the app is installed, user gets an approval popup.

Even before user clicks anything, the first 2 calls to "saveToPreferences" fail (both with the same message):

Failed to save configuration MyTransparentProxy: Error Domain=NEConfigurationErrorDomain Code=10 “permission denied” UserInfo={NSLocalizedDescription=permission denied}

The third call to "saveToPreferences()" does NOT return until a user either accepts or rejects the "allow vpn configuration" pop up.

My question is, how can I make all the calls to block the completion callback until user decision ?

For now, I figured out that this works as workaround:
In the initialization of the first proxy I do:

NEAppProxyProviderManager.loadAllFromPreferences {
    saveToPreferences { error in
      if (error) {
         /* failed to save */
      }
      /* saved */
      /* here I start the “next” proxies */
      StartNextProxy();
    }
}

In this case the first one is blocked until user accepts the pop up and once he does I start the second and the third proxies. This ensure avoidance of "permission denied" error as only one "saveToPreferences()" call waits for user approval.

This doesn’t feel like the correct method to me, is there a way for multiple proxy manager to wait for "VPN Configuration" approval event ?


问:
Using Chrome command line args --window-workspace not working
I'm trying to configure puppeteer to launch Chrome on a specific screen (or workspace) on macOS. I've found the --window-workspace CLI argument but it doesn't work. I tried every number from 0 to 10 (the number of workspaces I have on 3 screens), and the Chrome window shows up in the same workspace.

/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --window-workspace=3
```

Is there a different way of identifying the workspace?

This is especially useful when working with multiple monitors and debugging puppeteer with headless mode turned off, having the ability to designate a screen where the window shows up would better the developer UX.

Body:
I'm trying to configure puppeteer to launch Chrome on a specific screen (or workspace) on macOS. I've found the --window-workspace CLI argument but it doesn't work. I tried every number from 0 to 10 (the number of workspaces I have on 3 screens), and the Chrome window shows up in the same workspace.

/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --window-workspace=3

Is there a different way of identifying the workspace?

This is especially useful when working with multiple monitors and debugging puppeteer with headless mode turned off, having the ability to designate a screen where the window shows up would better the developer UX.


问:
Assertion failing even though the values seem to match
```<code>public void ClaimValidation() {

   float validateMemberPay = S3_1Response.jsonPath().get("planCopayAmount");
   softAssert.assertEquals(validateMemberPay, 300.00);
   float validatePlanPay = S3_1Response.jsonPath().get("planPayAmount");
   softAssert.assertEquals(validatePlanPay, 800.00, assertionMessage);
softAssert.AssertAll();
</code>```

expected [300.0] but found [300.0],

ASSERTION HAS FAILED expected [800.0] but found [800.0]

Body:
public void ClaimValidation() {

   float validateMemberPay = S3_1Response.jsonPath().get("planCopayAmount");
   softAssert.assertEquals(validateMemberPay, 300.00);
   float validatePlanPay = S3_1Response.jsonPath().get("planPayAmount");
   softAssert.assertEquals(validatePlanPay, 800.00, assertionMessage);
softAssert.AssertAll();

expected [300.0] but found [300.0],

ASSERTION HAS FAILED expected [800.0] but found [800.0]


问:
Returns an empty array
I am trying to get the data from this endpoint but I am getting an empty array. Can you help me with this? thanks

I've been trying to do it, with the other methods I have I can get the corresponding data.

I tried several ways but still can't find a solution.

```<code>http://localhost:8081/getmnemonicsandtagsforabm this is the methood
</code>```
```<code>const DataTable = () => {
  const provider = useContext(AppContext);

  let [editServiceStatus, setEditServiceStatus] = useState(false);

  let [configServiceStatusButton, setConfigServiceStatusButton] =
    useState(false);

  let [serviceItem_selected, setServiceItem_selected] = useState([]);

  let [fetchServiceDetail, setFetchServiceDetail] = useState([]);

  let sessionID = localStorage.getItem("session_id");

  const [array_services, setArray_services] = useState({ khad_services: [] });

  const [array_services2, setArray_services2] = useState({ khad_services: [] });

  const [active_dropdown, setActive_dropdown] = useState(false);

  const [active_serviceConfig, setActive_serviceConfig] = useState(false);

  useEffect(() => {
    let session_id = {
      session_id: sessionID,
    };

    fetch("http://localhost:8081/getservicelist", {
      method: "POST",
      body: JSON.stringify(session_id),
    })
      .then((res) => res.json())
      .then((data) => {
        //console.log(`****__ data: __****: `, data);

        localStorage.setItem("array_services", JSON.stringify(data));

        setArray_services(data);
      })
      .catch((err) => console.log(err));

  }, []);

  useEffect(() => {
    let session_id = {
      session_id: sessionID,
    };
    fetch("http://localhost:8081/getmnemonicsandtagsforabm", {
      method: "POST",
      body: JSON.stringify(session_id),
    })
      .then((res) => res.json())
      .then((data) => {
        console.log(`****__ data:__****: `, data);
        localStorage.setItem("mnemonicsAndTags", JSON.stringify(data));
        localStorage.setItem("mnemonics", JSON.stringify(data.mnemonics));
        localStorage.setItem("tags", JSON.stringify(data.tags));
        localStorage.setItem("tagsForMnemonics", JSON.stringify(data.tagsForMnemonics));
        setArray_services(data);
      })
      .catch((err) => console.log(err));
  }, []);
</code>```

I await the return of the array accordingly

Title: Returns an empty array

Body:
I am trying to get the data from this endpoint but I am getting an empty array. Can you help me with this? thanks

I've been trying to do it, with the other methods I have I can get the corresponding data.

I tried several ways but still can't find a solution.

http://localhost:8081/getmnemonicsandtagsforabm this is the methood

const DataTable = () => {
  const provider = useContext(AppContext);

  let [editServiceStatus, setEditServiceStatus] = useState(false);

  let [configServiceStatusButton, setConfigServiceStatusButton] =
    useState(false);

  let [serviceItem_selected, setServiceItem_selected] = useState([]);

  let [fetchServiceDetail, setFetchServiceDetail] = useState([]);

  let sessionID = localStorage.getItem("session_id");

  const [array_services, setArray_services] = useState({ khad_services: [] });

  const [array_services2, setArray_services2] = useState({ khad_services: [] });

  const [active_dropdown, setActive_dropdown] = useState(false);

  const [active_serviceConfig, setActive_serviceConfig] = useState(false);

  useEffect(() => {
    let session_id = {
      session_id: sessionID,
    };

    fetch("http://localhost:8081/getservicelist", {
      method: "POST",
      body: JSON.stringify(session_id),
    })
      .then((res) => res.json())
      .then((data) => {
        //console.log(`****__ data: __****: `, data);

        localStorage.setItem("array_services", JSON.stringify(data));

        setArray_services(data);
      })
      .catch((err) => console.log(err));

  }, []);

  useEffect(() => {
    let session_id = {
      session_id: sessionID,
    };
    fetch("http://localhost:8081/getmnemonicsandtagsforabm", {
      method: "POST",
      body: JSON.stringify(session_id),
    })
      .then((res) => res.json())
      .then((data) => {
        console.log(`****__ data:__****: `, data);
        localStorage.setItem("mnemonicsAndTags", JSON.stringify(data));
        localStorage.setItem("mnemonics", JSON.stringify(data.mnemonics));
        localStorage.setItem("tags", JSON.stringify(data.tags));
        localStorage.setItem("tagsForMnemonics", JSON.stringify(data.tagsForMnemonics));
        setArray_services(data);
      })
      .catch((err) => console.log(err));
  }, []);

I await the return of the array accordingly


问:
how to display numbers as Persian(Farsi) when printing an HTML section using ngx-print module in angular?
I installed ngx-print module in angular 15.0.
I create a SCSS file in the assets folder in the project. SCSS file includes:

@font-face {
  font-family: 'mvazir';
  src:

    url('src/assets/fonts/Vazir-Regular-FD-WOL.woff') format('woff'),
    url('src/assets/fonts/Vazir-Regular-FD-WOL.woff2') format('woff2'),
    url('src/assets/fonts/Vazir-Regular-FD-WOL.ttf') format('truetype'),
    url('src/assets/fonts/Vazir-Regular-FD-WOL.eot'),
    url('src/assets/fonts/Vazir-Regular-FD-WOL-UI.woff') format('woff'),
    url('src/assets/fonts/Vazir-Regular-FD-WOL-UI.woff2') format('woff2'),
    url('src/assets/fonts/Vazir-Regular-FD-WOL-UI.ttf') format('truetype'),
    url('src/assets/fonts/Vazir-Regular-FD-WOL-UI.eot');

  font-style:normal;
  font-weight:normal;
}

table{

  width: 100%;
}

td, th {
  border-top: black 1px solid;
  text-align: center;
  font-family: 'mvazir' ;
  color: red;
}

span{
  font-family: 'mvazir';
  direction: rtl;
}
```

<p>HTML code to print is:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><div id="print-Invoice">
<hr>
  <table>
    <tr>
      <th>مبلغ کل</th>
      <th>فی (مبلغ کالا)</th>
      <th>متراژ</th>
      <th>وزن (تعداد)</th>
      <th>نام کالا</th>
      <th>ردیف</th>
    </tr>
    <tr *ngFor="let ic of ommoditiesForList;let idx=index;">
      <td>{{ic.itemPrice}}</td>
      <td>{{ic.salesPrice}}</td>
      <td>{{ic.meterage}}</td>
      <td>{{ic.tonnageOrNumber}}</td>
      <td>{{ic.commodity.commodityName}}</td>
      <td>{{idx}}</td>
    </tr>
  </table>

</div>

<button
  styleSheetFile="assets/print-css/print.scss"
  [previewOnly]="true"
  printTitle="MyTitle"
  printSectionId="print-Invoice"
  ngxPrint>print</button></code>```

I want the above fonts to be applied to the printed output. But unfortunately, none of the above fonts are applied. How to apply the above fonts to both letters and numbers?

Body:
I installed ngx-print module in angular 15.0.
I create a SCSS file in the assets folder in the project. SCSS file includes:

@font-face {
  font-family: 'mvazir';
  src:

    url('src/assets/fonts/Vazir-Regular-FD-WOL.woff') format('woff'),
    url('src/assets/fonts/Vazir-Regular-FD-WOL.woff2') format('woff2'),
    url('src/assets/fonts/Vazir-Regular-FD-WOL.ttf') format('truetype'),
    url('src/assets/fonts/Vazir-Regular-FD-WOL.eot'),
    url('src/assets/fonts/Vazir-Regular-FD-WOL-UI.woff') format('woff'),
    url('src/assets/fonts/Vazir-Regular-FD-WOL-UI.woff2') format('woff2'),
    url('src/assets/fonts/Vazir-Regular-FD-WOL-UI.ttf') format('truetype'),
    url('src/assets/fonts/Vazir-Regular-FD-WOL-UI.eot');

  font-style:normal;
  font-weight:normal;
}

table{

  width: 100%;
}

td, th {
  border-top: black 1px solid;
  text-align: center;
  font-family: 'mvazir' ;
  color: red;
}

span{
  font-family: 'mvazir';
  direction: rtl;
}

HTML code to print is:

      مبلغ کل
      فی (مبلغ کالا)
      متراژ
      وزن (تعداد)
      نام کالا
      ردیف

      {{ic.itemPrice}}
      {{ic.salesPrice}}
      {{ic.meterage}}
      {{ic.tonnageOrNumber}}
      {{ic.commodity.commodityName}}
      {{idx}}

<button
  styleSheetFile="assets/print-css/print.scss"
  [previewOnly]="true"
  printTitle="MyTitle"
  printSectionId="print-Invoice"
  ngxPrint>print</button>

I want the above fonts to be applied to the printed output. But unfortunately, none of the above fonts are applied. How to apply the above fonts to both letters and numbers?


问:
Vue2: Binding v-model via computed property?
I have this component that shows a whole bunch of different components. Like so:

```<code>    computed: {
        ...mapGetters('forms', ['formErrors']),
        input: {
            get() {
                return this.value;
            },
            set(val) {
                this.$emit('input', val);
            },
        },
        component() {
            const components = {
                'ls-text-field': () =>
                    import('../../../../common/ls-text-field.vue'),
                'simple-date-picker': () =>
                    import('../../../../common/simple-date-picker.vue'),
                select: 'v-select',
                combobox: 'v-combobox',
            };

            return components[this.setting.component];
        },
        attributes() {
            const attrs = {
                'ls-text-field': {
                    label: this.setting.name,
                },
                'simple-date-picker': {},
                select: {
                    label: 'Select this foo',
                    items: this.setting.options,
                },
                combobox: {
                    'return-object': true,
                    items: this.productList,
                    loading: this.loading_product_list,
                    'item-value': 'sku',
                    'item-text': 'sku',
                    label: this.setting.name,
                    name: this.setting.key,
                },
            };

            return {
                ...attrs[this.setting.component],
                'error-messages': this.formErrors(this.setting.key),
            };
        },
    },
</code>```

and the Template looks something like this:

```<code><template>
    <v-col md="4" cols="12">
        <component
            :is="component"
            v-bind="attributes"
            v-model="input"
            :search-input.sync="searchSku"
        />

</code>```

But you'll notice I had to do v-model in the template and not in the computed property. I suppose there is NO way to do this:

```<code>        attributes() {
            const attrs = {
                'ls-text-field': {
                    label: this.setting.name,
                },
                'simple-date-picker': {},
                select: {
                    label: 'Select this foo',
                    items: this.setting.options,
                },
                combobox: {
                    'return-object': true,
                    items: this.productList,
                    loading: this.loading_product_list,
                    'item-value': 'sku',
                    'item-text': 'sku',
                    label: this.setting.name,
                    name: this.setting.key,
                    'v-model': this.item.info.someKey // This doesn't seem possible
                },
            };

</code>```

Body:
I have this component that shows a whole bunch of different components. Like so:

    computed: {
        ...mapGetters('forms', ['formErrors']),
        input: {
            get() {
                return this.value;
            },
            set(val) {
                this.$emit('input', val);
            },
        },
        component() {
            const components = {
                'ls-text-field': () =>
                    import('../../../../common/ls-text-field.vue'),
                'simple-date-picker': () =>
                    import('../../../../common/simple-date-picker.vue'),
                select: 'v-select',
                combobox: 'v-combobox',
            };

            return components[this.setting.component];
        },
        attributes() {
            const attrs = {
                'ls-text-field': {
                    label: this.setting.name,
                },
                'simple-date-picker': {},
                select: {
                    label: 'Select this foo',
                    items: this.setting.options,
                },
                combobox: {
                    'return-object': true,
                    items: this.productList,
                    loading: this.loading_product_list,
                    'item-value': 'sku',
                    'item-text': 'sku',
                    label: this.setting.name,
                    name: this.setting.key,
                },
            };

            return {
                ...attrs[this.setting.component],
                'error-messages': this.formErrors(this.setting.key),
            };
        },
    },

and the Template looks something like this:

<template>
    <v-col md="4" cols="12">
        <component
            :is="component"
            v-bind="attributes"
            v-model="input"
            :search-input.sync="searchSku"
        />

But you'll notice I had to do v-model in the template and not in the computed property. I suppose there is NO way to do this:

        attributes() {
            const attrs = {
                'ls-text-field': {
                    label: this.setting.name,
                },
                'simple-date-picker': {},
                select: {
                    label: 'Select this foo',
                    items: this.setting.options,
                },
                combobox: {
                    'return-object': true,
                    items: this.productList,
                    loading: this.loading_product_list,
                    'item-value': 'sku',
                    'item-text': 'sku',
                    label: this.setting.name,
                    name: this.setting.key,
                    'v-model': this.item.info.someKey // This doesn't seem possible
                },
            };


问:
Odoo v16e selected Partners break up on a customised report
I'm customizing a report through configuration->Management->Accounting Reports and I need a breakup of a few specific partners' balances not all. I tried putting desired partner's Id into the domain but I get the error "AttributeError: 'bool' object has no attribute 'replace'".

My current settings


问:
Entity Framework Core 7 not populating all of related object when using include
I have the following models set up in Entity Framework Core 7:

```<code>class Owner
{
    Guid Id;
    Guid OrgId;
}

abstract class ModelBase
{
    Guid Id;
    Guid OwnerId;
    Owner Owner;
}

class Product : ModelBase
{
    string Name;
    decimal Price;
}
</code>```

In the migration I run the following to configure the relationship:

```<code>migrationBuilder.CreateTable(
            name: "Owners",
            columns: table => new
            {
                Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false, defaultValueSql: "NEWID()"),
                OrgId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
            },
            constraints: table =>
            {
                table.PrimaryKey("PK_Owners", x => x.Id);
            });

migrationBuilder.CreateTable(
            name: "Products",
            columns: table => new
            {
                Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false, defaultValueSql: "NEWID()"),
                OwnerId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
                Price = table.Column<decimal>(type: "decimal(18,2)", nullable: false)
            },
            constraints: table =>
            {
                table.PrimaryKey("PK_Products", x => x.Id);
                table.ForeignKey(
                    name: "FK_Products_Owners_OwnerId",
                    column: x => x.OwnerId,
                    principalTable: "Owners",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Cascade);
            });
</code>```

However when I run the following:

```<code>var entity = DBContext
                 .Set<Product>()
                 .Include(e => e.Owner)
                 .FirstOrDefault();
</code>```

entity.Owner is non null, and has Id set to the expected value, but OrgId is set to 00000000-0000-0000-0000-000000000000.  When I check the database, the row contains an expected value for OrgId, which is different to the above.

Why isn't Entity Framework Core 7 correctly populating the OrgId field of the returned model?

Body:
I have the following models set up in Entity Framework Core 7:

class Owner
{
    Guid Id;
    Guid OrgId;
}

abstract class ModelBase
{
    Guid Id;
    Guid OwnerId;
    Owner Owner;
}

class Product : ModelBase
{
    string Name;
    decimal Price;
}

In the migration I run the following to configure the relationship:

migrationBuilder.CreateTable(
            name: "Owners",
            columns: table => new
            {
                Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false, defaultValueSql: "NEWID()"),
                OrgId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
            },
            constraints: table =>
            {
                table.PrimaryKey("PK_Owners", x => x.Id);
            });

migrationBuilder.CreateTable(
            name: "Products",
            columns: table => new
            {
                Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false, defaultValueSql: "NEWID()"),
                OwnerId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
                Price = table.Column<decimal>(type: "decimal(18,2)", nullable: false)
            },
            constraints: table =>
            {
                table.PrimaryKey("PK_Products", x => x.Id);
                table.ForeignKey(
                    name: "FK_Products_Owners_OwnerId",
                    column: x => x.OwnerId,
                    principalTable: "Owners",
                    principalColumn: "Id",
                    onDelete: ReferentialAction.Cascade);
            });

However when I run the following:

var entity = DBContext
                 .Set<Product>()
                 .Include(e => e.Owner)
                 .FirstOrDefault();

entity.Owner is non null, and has Id set to the expected value, but OrgId is set to 00000000-0000-0000-0000-000000000000.  When I check the database, the row contains an expected value for OrgId, which is different to the above.

Why isn't Entity Framework Core 7 correctly populating the OrgId field of the returned model?


问:
Activity has leaked window that was originally added here in fragment of dialog box
I am trying to display success dialog on payment done but facing this error.
here is my code

```<code>Dialog dialog;
    dialog = new Dialog(getActivity());
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.payment_sucesss_online);
    dialog.setCanceledOnTouchOutside(false);
    dialog.show();
    dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    AppCompatButton btn_okay=dialog.findViewById(R.id.btn_okay);
    btn_okay.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Log.e("loge", "onClick: " );
            dialog.dismiss();
            Bundle b = new Bundle();
            ((SmartWristActivity) getActivity()).changeFragWithArgs(new SmartWristPurchaseDashboard(), "OnlineStore", b);

        }
    });
</code>```

P.S.:-I'm using fragment

Body:
I am trying to display success dialog on payment done but facing this error.
here is my code

Dialog dialog;
    dialog = new Dialog(getActivity());
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.payment_sucesss_online);
    dialog.setCanceledOnTouchOutside(false);
    dialog.show();
    dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    AppCompatButton btn_okay=dialog.findViewById(R.id.btn_okay);
    btn_okay.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Log.e("loge", "onClick: " );
            dialog.dismiss();
            Bundle b = new Bundle();
            ((SmartWristActivity) getActivity()).changeFragWithArgs(new SmartWristPurchaseDashboard(), "OnlineStore", b);

        }
    });

P.S.:-I'm using fragment


问:
yolov7 ImportError: DLL load failed while importing _fblas: %1 is not a Win32 application
When I start the tutorial it shows an error. I am using windows 11 64 bit. I installed all the packages through anaconda, and I can’t understand what the problem could be. (Python 3.9)

```<code>Traceback (most recent call last):
  File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\train.py", line 24, in <module>
    import test  # import test.py to get mAP after each epoch
  File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\test.py", line 12, in <module>
    from models.experimental import attempt_load
  File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\models\experimental.py", line 6, in <module>
    from models.common import Conv, DWConv
  File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\models\common.py", line 17, in <module>
    from utils.plots import color_list, plot_one_box
  File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\utils\plots.py", line 19, in <module>
    from scipy.signal import butter, filtfilt
  File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\signal\__init__.py", line 309, in <module>
    from . import _sigtools, windows
  File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\signal\windows\__init__.py", line 41, in <module>
    from ._windows import *
  File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\signal\windows\_windows.py", line 7, in <module>
    from scipy import linalg, special, fft as sp_fft
  File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\__init__.py", line 233, in __getattr__
    return _importlib.import_module(f'scipy.{name}')
  File "C:\Users\iirof\anaconda3\envs\rf\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\linalg\__init__.py", line 197, in <module>
    from ._misc import *
  File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\linalg\_misc.py", line 3, in <module>
    from .blas import get_blas_funcs
  File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\linalg\blas.py", line 213, in <module>
    from scipy.linalg import _fblas
ImportError: DLL load failed while importing _fblas: %1 не является приложением Win32.
</code>```

Tried to install different versions of python, but nothing new.

Body:
When I start the tutorial it shows an error. I am using windows 11 64 bit. I installed all the packages through anaconda, and I can’t understand what the problem could be. (Python 3.9)

Traceback (most recent call last):
  File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\train.py", line 24, in <module>
    import test  # import test.py to get mAP after each epoch
  File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\test.py", line 12, in <module>
    from models.experimental import attempt_load
  File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\models\experimental.py", line 6, in <module>
    from models.common import Conv, DWConv
  File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\models\common.py", line 17, in <module>
    from utils.plots import color_list, plot_one_box
  File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\utils\plots.py", line 19, in <module>
    from scipy.signal import butter, filtfilt
  File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\signal\__init__.py", line 309, in <module>
    from . import _sigtools, windows
  File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\signal\windows\__init__.py", line 41, in <module>
    from ._windows import *
  File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\signal\windows\_windows.py", line 7, in <module>
    from scipy import linalg, special, fft as sp_fft
  File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\__init__.py", line 233, in __getattr__
    return _importlib.import_module(f'scipy.{name}')
  File "C:\Users\iirof\anaconda3\envs\rf\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\linalg\__init__.py", line 197, in <module>
    from ._misc import *
  File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\linalg\_misc.py", line 3, in <module>
    from .blas import get_blas_funcs
  File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\linalg\blas.py", line 213, in <module>
    from scipy.linalg import _fblas
ImportError: DLL load failed while importing _fblas: %1 не является приложением Win32.

Tried to install different versions of python, but nothing new.


问:
When does RoomDB insert data into the database? Why is my insert not getting written right away?
The app I'm working on inserts a row in a database and then show it on the UI. Looking at the app, I can see that the row was added since I can see it in the list once the insert is called. By the way I'm using flow in my Dao class and collect it in the UI(jetpack compose) such as

```<code>  @Query("Select from ... ")
  abstract fun getAsFlow(headerId : Long) : Flow<List<Product>>
</code>```

On my app there's a functionality that copies the database to external storage. When I open the database that was copied to the external storage, the table where I inserted the row is empty. But I can see it loading in the app even if I exit the application and then reload that page.

I tried closing the connection before copying the database to external storage but that didn't work.

I guess what I want to understand the is timing when a data gets written. Because I am getting reports that the the inserted rows gets lost. How can I make sure that the rows I inserted gets written in to the database before I do the copy?

Body:
The app I'm working on inserts a row in a database and then show it on the UI. Looking at the app, I can see that the row was added since I can see it in the list once the insert is called. By the way I'm using flow in my Dao class and collect it in the UI(jetpack compose) such as

  @Query("Select from ... ")
  abstract fun getAsFlow(headerId : Long) : Flow<List<Product>>

On my app there's a functionality that copies the database to external storage. When I open the database that was copied to the external storage, the table where I inserted the row is empty. But I can see it loading in the app even if I exit the application and then reload that page.

I tried closing the connection before copying the database to external storage but that didn't work.

I guess what I want to understand the is timing when a data gets written. Because I am getting reports that the the inserted rows gets lost. How can I make sure that the rows I inserted gets written in to the database before I do the copy?


问:
PodTopologyConstraints - DoNotSchedule not working as expected
I tried to use PodTopologySpreadConstraint to organize our deployment engine, and to spread replicas across zones.

```<code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  selector:
    matchLabels:
      app: nginx
  replicas: 4
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:alpine
        ports:
        - containerPort: 80
      topologySpreadConstraints:
      - maxSkew: 1
        topologyKey: topology.kubernetes.io/zone
        whenUnsatisfiable: DoNotSchedule
        labelSelector:
          matchLabels:
            app: nginx
      tolerations:
      - effect: NoSchedule
        key: platform
        operator: Equal
        value: "true"
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: nodes
                operator: In
                values:
                - platform
</code>```

I expected that, if I have just one node labeled "platform", the scheduler needs to run just one replica of Nginx, and others need to be in a "pending" state because "DoNotSchedule" constraint is not satisfied.

But the deployment running the 4 replicas in the same node/zone, even that "DoNotSchedule" defined.

```<code>➜ kubectl get pods -o wide | grep nginx-deployment
nginx-deployment-6cbbb547c-6qvrg   1/1     Running            0               15m     192.168.33.28    ip-192-168-42-2.sa-east-1.compute.internal     <none>           <none>
nginx-deployment-6cbbb547c-cgbcf   1/1     Running            0               15m     192.168.37.251   ip-192-168-42-2.sa-east-1.compute.internal     <none>           <none>
nginx-deployment-6cbbb547c-dlqvd   1/1     Running            0               15m     192.168.47.173   ip-192-168-42-2.sa-east-1.compute.internal     <none>           <none>
nginx-deployment-6cbbb547c-hkgzc   1/1     Running            0               15m     192.168.39.27    ip-192-168-42-2.sa-east-1.compute.internal     <none>           <none>
</code>```

and i just have one node labeled "platform"

```<code>➜ kubectl get nodes -l app=platform
NAME                                         STATUS   ROLES    AGE     VERSION
ip-192-168-42-2.sa-east-1.compute.internal   Ready    <none>   4h45m   v1.22.15-eks-fb459a0
</code>```

Does anyone have any idea what I made wrong?

Body:
I tried to use PodTopologySpreadConstraint to organize our deployment engine, and to spread replicas across zones.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  selector:
    matchLabels:
      app: nginx
  replicas: 4
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:alpine
        ports:
        - containerPort: 80
      topologySpreadConstraints:
      - maxSkew: 1
        topologyKey: topology.kubernetes.io/zone
        whenUnsatisfiable: DoNotSchedule
        labelSelector:
          matchLabels:
            app: nginx
      tolerations:
      - effect: NoSchedule
        key: platform
        operator: Equal
        value: "true"
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: nodes
                operator: In
                values:
                - platform

I expected that, if I have just one node labeled "platform", the scheduler needs to run just one replica of Nginx, and others need to be in a "pending" state because "DoNotSchedule" constraint is not satisfied.

But the deployment running the 4 replicas in the same node/zone, even that "DoNotSchedule" defined.

➜ kubectl get pods -o wide | grep nginx-deployment
nginx-deployment-6cbbb547c-6qvrg   1/1     Running            0               15m     192.168.33.28    ip-192-168-42-2.sa-east-1.compute.internal     <none>           <none>
nginx-deployment-6cbbb547c-cgbcf   1/1     Running            0               15m     192.168.37.251   ip-192-168-42-2.sa-east-1.compute.internal     <none>           <none>
nginx-deployment-6cbbb547c-dlqvd   1/1     Running            0               15m     192.168.47.173   ip-192-168-42-2.sa-east-1.compute.internal     <none>           <none>
nginx-deployment-6cbbb547c-hkgzc   1/1     Running            0               15m     192.168.39.27    ip-192-168-42-2.sa-east-1.compute.internal     <none>           <none>

and i just have one node labeled "platform"

➜ kubectl get nodes -l app=platform
NAME                                         STATUS   ROLES    AGE     VERSION
ip-192-168-42-2.sa-east-1.compute.internal   Ready    <none>   4h45m   v1.22.15-eks-fb459a0

Does anyone have any idea what I made wrong?


问:
How to call multiple macros via Python
I've succeeded to call one macro through Python from my Macro-enabled workbook to the workbook I want to apply my macro on, however, i can only call 1 macro, how to call multiple macros?

I believe I should manipulate a line in the below 3 lines to make it work but don't know which exactly ?

```<code>wb = xw.books.open(r'C:\Automation\Resources\MAcro codes.xlsb')
macroname = wb.macro('Iwebsite')
macroname()
</code>```

Full Code:

```<code>import glob
import os
from subprocess import Popen
import os, os.path
import xlwings as xw
import os
import sys

list_of_files = glob.glob('C:/Users/Martina/Downloads/*.csv')
latest_csv_file = max(list_of_files, key=os.path.getctime)
print(latest_csv_file)
file_name =latest_csv_file
os.startfile(file_name)

from os import listdir
from os.path import isfile, join
 wb = xw.books.open(r'C:\Automation\Resources\MAcro codes.xlsb')
    macroname = wb.macro('Iwebsite')
    macroname()
def python_macro(wb_path, app):
    # Optionally verify that files are all xls*, csv, or directory files

    wb = app.books.open(wb_path)
    sheet = wb.sheets.active

    # Rewrite macro in python+xlwings below
    print(sheet.range('A1').value)

with xw.App() as app:
    for arg in sys.argv[1:]:
        path = join(os.getcwd(), arg)

        if os.path.isdir(path):
            # Optionally process further subdirectories

            files = [f for f in listdir(path) if isfile(join(path, f))]

            for file in files:
                python_macro(file, app)

        elif os.path.isfile(path):
            python_macro(path, app)
</code>```

Title: How to call multiple macros via Python

Body:
I've succeeded to call one macro through Python from my Macro-enabled workbook to the workbook I want to apply my macro on, however, i can only call 1 macro, how to call multiple macros?

I believe I should manipulate a line in the below 3 lines to make it work but don't know which exactly ?

wb = xw.books.open(r'C:\Automation\Resources\MAcro codes.xlsb')
macroname = wb.macro('Iwebsite')
macroname()

Full Code:

import glob
import os
from subprocess import Popen
import os, os.path
import xlwings as xw
import os
import sys

list_of_files = glob.glob('C:/Users/Martina/Downloads/*.csv')
latest_csv_file = max(list_of_files, key=os.path.getctime)
print(latest_csv_file)
file_name =latest_csv_file
os.startfile(file_name)

from os import listdir
from os.path import isfile, join
 wb = xw.books.open(r'C:\Automation\Resources\MAcro codes.xlsb')
    macroname = wb.macro('Iwebsite')
    macroname()
def python_macro(wb_path, app):
    # Optionally verify that files are all xls*, csv, or directory files

    wb = app.books.open(wb_path)
    sheet = wb.sheets.active

    # Rewrite macro in python+xlwings below
    print(sheet.range('A1').value)

with xw.App() as app:
    for arg in sys.argv[1:]:
        path = join(os.getcwd(), arg)

        if os.path.isdir(path):
            # Optionally process further subdirectories

            files = [f for f in listdir(path) if isfile(join(path, f))]

            for file in files:
                python_macro(file, app)

        elif os.path.isfile(path):
            python_macro(path, app)


问:
How to resize a window in MacOS App (Swift)
I need to create a Mac OS App. The idea is detect when the user moves the window with the mouse. When I know which window is I need to resize.

I have this code.

Active Window
In this struct I store the information for the Windows

```<code>struct ActiveWindow {
   let frame: CGRect
   let applicationName: String
   let windowId: Int

   init(frame: CGRect, applicationName: String, windowId: Int) {
      self.frame = frame.flippedScreenBounds
      self.applicationName = applicationName
      self.windowId = windowId
   }

   var isFocus: Bool {
       return applicationName.caseInsensitiveCompare("ReSize") == .orderedSame
   }
}
</code>```

Windows List
Here I get an array for all windows opened into the OS

```<code>struct WindowList {
    static func allWindows() -> [ActiveWindow] {
         let options = CGWindowListOption(arrayLiteral: .excludeDesktopElements, .optionOnScreenOnly)
         let windowsListInfo = CGWindowListCopyWindowInfo(options, CGMainDisplayID()) // This is the current windows
         let infoList = windowsListInfo as! [[String: Any]]
         return infoList.filter { $0["kCGWindowLayer"] as! Int == 0 }
            .map { ActiveWindow(
            frame: CGRect(x: ($0["kCGWindowBounds"] as! [String: Any])["X"] as! CGFloat,
                   y: ($0["kCGWindowBounds"] as! [String: Any])["Y"] as! CGFloat,
                   width: ($0["kCGWindowBounds"] as! [String: Any])["Width"] as! CGFloat,
                   height: ($0["kCGWindowBounds"] as! [String: Any])["Height"] as! CGFloat),
            applicationName: $0["kCGWindowOwnerName"] as! String,
            windowId: $0["kCGWindowNumber"] as! Int)}
}

    static func window(at point: CGPoint) -> ActiveWindow? {
       let list = allWindows()
       return list.filter{ $0.frame.contains(point) }.first
   }
}
</code>```

This is my ViewController

```<code>class ViewController: NSViewController {
    private lazy var windowMain: NSWindow = self.view.window!
    private var highlightWindowController: HighlighWindowController?
    private var currentView: ActiveWindow?
    private var mouseLocation: NSPoint = NSEvent.mouseLocation {
       didSet {
           if let window = WindowList.window(at: mouseLocation), !window.isFocus {
               self.currentView = window
               highlight(window: window)
           } else {
               removeHighlight()
           }
       }
}
</code>```

Into my viewDidLoad register the mouse event.
The idea is get the all information about the windows when the user passes the course over the window

```<code>override func viewDidLoad() {
        super.viewDidLoad()
        registerMouseEvents()

    }
</code>```
```<code>    private func registerMouseEvents() {
        NSEvent.addLocalMonitorForEvents(matching: [.mouseMoved]) {
            self.mouseLocation = NSEvent.mouseLocation
            return $0
        }
        NSEvent.addGlobalMonitorForEvents(matching: [.mouseMoved]) { _ in
            self.mouseLocation = NSEvent.mouseLocation
        }
    }
</code>```

This is my first approach.

Body:
I need to create a Mac OS App. The idea is detect when the user moves the window with the mouse. When I know which window is I need to resize.

I have this code.

Active Window
In this struct I store the information for the Windows

struct ActiveWindow {
   let frame: CGRect
   let applicationName: String
   let windowId: Int

   init(frame: CGRect, applicationName: String, windowId: Int) {
      self.frame = frame.flippedScreenBounds
      self.applicationName = applicationName
      self.windowId = windowId
   }

   var isFocus: Bool {
       return applicationName.caseInsensitiveCompare("ReSize") == .orderedSame
   }
}

Windows List
Here I get an array for all windows opened into the OS

struct WindowList {
    static func allWindows() -> [ActiveWindow] {
         let options = CGWindowListOption(arrayLiteral: .excludeDesktopElements, .optionOnScreenOnly)
         let windowsListInfo = CGWindowListCopyWindowInfo(options, CGMainDisplayID()) // This is the current windows
         let infoList = windowsListInfo as! [[String: Any]]
         return infoList.filter { $0["kCGWindowLayer"] as! Int == 0 }
            .map { ActiveWindow(
            frame: CGRect(x: ($0["kCGWindowBounds"] as! [String: Any])["X"] as! CGFloat,
                   y: ($0["kCGWindowBounds"] as! [String: Any])["Y"] as! CGFloat,
                   width: ($0["kCGWindowBounds"] as! [String: Any])["Width"] as! CGFloat,
                   height: ($0["kCGWindowBounds"] as! [String: Any])["Height"] as! CGFloat),
            applicationName: $0["kCGWindowOwnerName"] as! String,
            windowId: $0["kCGWindowNumber"] as! Int)}
}

    static func window(at point: CGPoint) -> ActiveWindow? {
       let list = allWindows()
       return list.filter{ $0.frame.contains(point) }.first
   }
}

This is my ViewController

class ViewController: NSViewController {
    private lazy var windowMain: NSWindow = self.view.window!
    private var highlightWindowController: HighlighWindowController?
    private var currentView: ActiveWindow?
    private var mouseLocation: NSPoint = NSEvent.mouseLocation {
       didSet {
           if let window = WindowList.window(at: mouseLocation), !window.isFocus {
               self.currentView = window
               highlight(window: window)
           } else {
               removeHighlight()
           }
       }
}

Into my viewDidLoad register the mouse event.
The idea is get the all information about the windows when the user passes the course over the window

override func viewDidLoad() {
        super.viewDidLoad()
        registerMouseEvents()

    }

    private func registerMouseEvents() {
        NSEvent.addLocalMonitorForEvents(matching: [.mouseMoved]) {
            self.mouseLocation = NSEvent.mouseLocation
            return $0
        }
        NSEvent.addGlobalMonitorForEvents(matching: [.mouseMoved]) { _ in
            self.mouseLocation = NSEvent.mouseLocation
        }
    }

This is my first approach.


问:
How to turn MUI Slider Thumb from Circle to Square in Kotlin
I'm currently creating a React application with Kotlin and am currently trying to a implement a drag time selector similar to this: https://user-images.githubusercontent.com/35810850/209967764-b715e90e-7da3-4d37-8192-502a035a6cd4.png and thought using the MUI Slider might be the best work around in doing so. I've ran into a couple of blocks and am having difficulty in changing the sliders thumb into a square. Following the documentation, I tried changing the thumb into a square by getting rid of the border-radius:

```<code>.MuiSlider-thumb{
    width: 50px;
    height: 50px;
    border-radius: 0%;
}
</code>```

Unfortunately, nothing changes. In my search for trying to find a solution.

I used these for reference as well, still no good. X X

One thing I do notice though is that:

```<code>.MuiSlider-thumb:is(:hover, .Mui-active,) {
    height: 20px;
    width 30px;
    border-radius: 0px;
}
</code>```

works for me of course only when hovered/active. Also strange that the width and height are different sizes but make a square. If I have 20x20, it comes out as a rectangle instead. If there is a different way of creating the time selector or fixing Slider, please do help!

I tried to give the thumb a border radius of 0 and was expecting a square, not a circle. What resulted was a circle, but a square when hovered.

Body:
I'm currently creating a React application with Kotlin and am currently trying to a implement a drag time selector similar to this: https://user-images.githubusercontent.com/35810850/209967764-b715e90e-7da3-4d37-8192-502a035a6cd4.png and thought using the MUI Slider might be the best work around in doing so. I've ran into a couple of blocks and am having difficulty in changing the sliders thumb into a square. Following the documentation, I tried changing the thumb into a square by getting rid of the border-radius:

.MuiSlider-thumb{
    width: 50px;
    height: 50px;
    border-radius: 0%;
}

Unfortunately, nothing changes. In my search for trying to find a solution.

I used these for reference as well, still no good. X X

One thing I do notice though is that:

.MuiSlider-thumb:is(:hover, .Mui-active,) {
    height: 20px;
    width 30px;
    border-radius: 0px;
}

works for me of course only when hovered/active. Also strange that the width and height are different sizes but make a square. If I have 20x20, it comes out as a rectangle instead. If there is a different way of creating the time selector or fixing Slider, please do help!

I tried to give the thumb a border radius of 0 and was expecting a square, not a circle. What resulted was a circle, but a square when hovered.


问:
redirect_uri Parameter error on WeChat SSO on redirection of authentication url
I am implementing WeChat SSO for my web application, I have developer account, created an application there, followed this article exactly. I am using React on front-end and flask on backend.
I am using this package for flask for WeChat-sso.
So in my weChat dashboard I have registered official website e.g (chess.com), but I have to use callback url in such way so I can test redirection on my dev server.

My dev front-end is on (localhost:8000/)
My backend server is running on (127.0.0.1:5050/)

I have tried saving different callback urls e.g (127.0.0.1:5050/api/users/wechat/callback), no matter what I save in callback url always receiving parameter error.

So my question is how do I actually achieve this functionality locally? Instead of parameter error I should be seeing QR code so that I can get code from which I can get access_token. Following code generates authentication url

```<code>from weixin import WXAPPAPI
from weixin.lib.wxcrypt import WXBizDataCrypt
from weixin.client import WeixinAPI

scope = ("snsapi_login",)
api = WeixinAPI(appid=WECHAT_APP_ID,
                app_secret=WECHAT_APP_SECRET,
                redirect_uri=WECHAT_REDIRECT_URI)
authorize_url = api.get_authorize_url(scope=scope)
</code>```

The authentication url generated is as follows, redirect URI is properly encoded just like in the documentation.

```<code>https://open.weixin.qq.com/connect/qrconnect?appid=wx35c78a124e8f027b&redirect_uri=127.0.0.1%3A5050%2Fapi%2Fusers%2Fwechat%2Fcallback&response_type=code&scope=snsapi_base&state=689db1f29605481a492639e98c7b1f9f#wechat_redirect
</code>```

Please look at the picture of error as well thanks

Body:
I am implementing WeChat SSO for my web application, I have developer account, created an application there, followed this article exactly. I am using React on front-end and flask on backend.
I am using this package for flask for WeChat-sso.
So in my weChat dashboard I have registered official website e.g (chess.com), but I have to use callback url in such way so I can test redirection on my dev server.

My dev front-end is on (localhost:8000/)
My backend server is running on (127.0.0.1:5050/)

I have tried saving different callback urls e.g (127.0.0.1:5050/api/users/wechat/callback), no matter what I save in callback url always receiving parameter error.

So my question is how do I actually achieve this functionality locally? Instead of parameter error I should be seeing QR code so that I can get code from which I can get access_token. Following code generates authentication url

from weixin import WXAPPAPI
from weixin.lib.wxcrypt import WXBizDataCrypt
from weixin.client import WeixinAPI

scope = ("snsapi_login",)
api = WeixinAPI(appid=WECHAT_APP_ID,
                app_secret=WECHAT_APP_SECRET,
                redirect_uri=WECHAT_REDIRECT_URI)
authorize_url = api.get_authorize_url(scope=scope)

The authentication url generated is as follows, redirect URI is properly encoded just like in the documentation.

https://open.weixin.qq.com/connect/qrconnect?appid=wx35c78a124e8f027b&redirect_uri=127.0.0.1%3A5050%2Fapi%2Fusers%2Fwechat%2Fcallback&response_type=code&scope=snsapi_base&state=689db1f29605481a492639e98c7b1f9f#wechat_redirect

Please look at the picture of error as well thanks


问:
Elasticsearch pagination move multiple pages forward
I am adding pagination to elastic search queries and im using the PointInTime api to get a record snapshot. This works great and i can page to the next results without issue. But the problem i cant figure out is how can i page multiple 'pages' ahead of the current result pointer?

If i have 10,000 results in a complete result-set and its broken up into pages of 20, how can i go from page 1 and skip directly to page 17, for example. If i page one page sequentially at a time then it works because i have the sort id for the search_after parameter, so this works fine. But when a user want to skip from  page 1 to page 17, then i dont have the sort id of page 16 to set the pointer to, how can this be done?

This is a C# project using the NEST packages.


问:
How to use GetDownloadURLPipeModule in non-compat version of @angular/fire?
I was recently trying to migrate my @angular/fire app from the compat version to non-compat version and realized that the GetDownloadURLPipeModule doesn't exist without the compat version.

Is there any way to use this without using the compat library?


问:
How to anchor the SnackBar at the top and keep the screen clickable?
I was able to add the SnackBar at the top using the Widget provided by flutter, but the margin overflow the content that's under the SnackBar.

That basically "disable" the screen while the SnackBar is being displayed.

Test yourself on dartpad

Follows a print of the guidelines tool on a test app:


问:
Is there a way to compress webp file with cwebp?
I've compressed millions of jpeg files with using Google cwebp.
But some of them weirdly are bigger than the original jpeg files.

So I'm looking for a way to compress more these big webp files but couldn't find a way as cwebp is giving an error when I try to compress them again.

This is the command I'm using.

cwebp test1.webp -o test11.webp -quiet -q 50


问:
Sign In page won't render in my React.js app
For some reason, I can't get my SignIn page to render when I click it on the Navbar. The route effectively changes to http://localhost:3000/signin, and that route is set up correctly to render my SignIn component, but the Home page stays the same and the SignIn button changes to "loading...". I'm using google authentication for the SignIn component, and I'm using an AuthCheck fallback and Suspense fallback in my Navbar.

NAVBAR CODE:

```<code>import React, { Suspense } from "react";
import { makeStyles } from "@material-ui/core/styles";
import AppBar from "@material-ui/core/AppBar";
import Toolbar from "@material-ui/core/Toolbar";
import Typography from "@material-ui/core/Typography";
import Button from "@material-ui/core/Button";
import Logo from '../assets/images/basketball.png';
import { Link } from 'react-router-dom';
import {AuthCheck} from 'reactfire'

const useStyles = makeStyles((theme) => ({
  root: {
    flexGrow: 1,
  },
  menuButton: {
    marginRight: theme.spacing(2),
  },
  title: {
    flexGrow: 1,
  },
  logo: {
    height: "50px",
  },
  link: {
    color: "black",
    textDecoration: "none",
    },
    }));

export const Navbar = () => {
  const classes = useStyles();

  return (
    <div className={classes.root}>
      <AppBar position="static">
        <Toolbar style={{ alignItems: "center", justifyContent: "center", backgroundColor: "rgb(0, 255, 225)" }}>
          <Link to="/">
            <img src={Logo} alt="Logo" className={classes.logo} />
          </Link>
          <Typography style={{flexDirection: 'column', display: 'flex', alignItems: 'center', justifyContent: 'center', color: 'black' }} variant="h2" className={classes.title}>
            NBA Stat Reference
          </Typography>
          <Suspense fallback={'loading...'}>
          <AuthCheck fallback={
          <Button style={{color: "black"}}>
              <Link className={classes.link} to="/signin">Sign In</Link>
          </Button>
          }>
          <Button color="black">
            <Link className={classes.link} to="/">Home</Link>
          </Button>
          <Button color="black">
            <Link className={classes.link} to="/dashboard">Dashboard</Link>
          </Button>
          <Button color="black">
            <Link className={classes.link} to="/about">About</Link>
          </Button>
          </AuthCheck>
          </Suspense>
        </Toolbar>
      </AppBar>
    </div>
  );
}

</code>```

SIGN IN CODE:

```<code>import React, { useState } from 'react'
import firebase from 'firebase/app';
import { AuthCheck, useAuth } from 'reactfire';
import 'firebase/auth';
import { Input } from './Input';
import { Container, Button, makeStyles, Typography, Snackbar,  } from '@material-ui/core';
import { withRouter } from "react-router-dom";
import MuiAlert from '@material-ui/lab/Alert';
import { Navbar } from './Navbar'

const Alert = (props) => {
  return <MuiAlert elevation={6} variant="filled" {...props} />
}

const useStyles = makeStyles({
    googleButton:{
        backgroundColor: 'rgb(66,133,244)',
        marginTop: '2em',
        padding: '0',
        color: 'white',
        height: '50px',
        width: '240px',
        border: 'none',
        textAlign: 'center',
        boxShadow: 'rgb(0 0 0 / 25%) 0px 2px 4px 0px',
        fontSize: '16px',
        lineHeight: '48px',
        display: 'block',
        borderRadius: '1px',
        fontFamily: 'Roboto, arial, sans-serif',
        cursor: 'pointer'
    },
    googleLogo:{
        width: '48px',
        height: '48px',
        display: 'block'
    },
    typographyStyle: {
        fontFamily: 'Roboto, arial, sans-serif;',
        textAlign: 'center',
        fontSize: '2em'
    },
    containerStyle: {
        marginTop: '2em'
    },
    snackBar: {
        color: 'white',
        backgroundColor: '#4caf50'
    }
});

export const SignIn = withRouter((props) => {
  const auth = useAuth();
  const classes = useStyles();
  const { history } = props;
  const [open, setOpen] = useState(false);

    const handleSnackOpen = () => {
        setOpen(true)
    };

    const handleSnackClose = (event, reason) => {
      if (reason === "clickaway") {
      return;
      }

      setOpen(false);
      history.push("/");
      };

    const sign_in = async () => {
        const response = await auth.signInWithPopup( new firebase.auth.GoogleAuthProvider());
        if(response.user){
            handleSnackOpen();
        }
    };

    const sign_out = async () => {
        await auth.signOut();
    }

    return (
        <div>
            <Navbar />
            <Container maxWidth = 'sm' className={classes.containerStyle}>
                <Typography className={classes.typographyStyle}>Sign In Below</Typography>
                <form>
                    <div>
                        <label htmlFor="email">Email</label>
                        <Input name="email" placeholder="Place Email Here" />
                    </div>
                    <div>
                        <label htmlFor="password">Password</label>
                        <Input name="password" placeholder="Place Password Here" />
                    </div>
                    <Button type="submit" variant='contained' color='primary'>Submit</Button>
                </form>

                <AuthCheck fallback={
                    <Button className={classes.googleButton} onClick={sign_in}>Sign In With Google</Button>
                }>
                    <Button variant='contained' color='secondary' onClick={sign_out}>Sign Out</Button>
                </AuthCheck>
                <Snackbar message={'Success'} open={open} autoHideDuration={6000} onClose={handleSnackClose}>
                    <Alert onClose={handleSnackClose} severity="success">
                        Successful Sign In - Redirect in 6 seconds
                    </Alert>
                </Snackbar>
            </Container>
        </div>
    )
});
</code>```

INDEX.JS (ROUTES)

```<code>import React from 'react';
import ReactDOM from 'react-dom';
import {Home} from './client/components/Home';
import {About} from './client/components/About';
import {Dashboard} from './client/components/Dashboard';
import {SignIn} from './client/components/SignIn'
import './index.css'
import {
  BrowserRouter as Router,
  Route,
  Switch
} from "react-router-dom";
import {firebaseConfig} from './firebaseConfig';
import {FirebaseAppProvider, AuthCheck} from 'reactfire';
import 'firebase/auth';
import {Provider} from 'react-redux';
import {store} from './client/Redux/store';
import * as ReactDOMClient from 'react-dom/client';

const root = ReactDOMClient.createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <FirebaseAppProvider firebaseConfig={firebaseConfig} suspense={true}>
    <Provider store={store}>

      <Router>
        <Switch>
          <Route exact path="/">
            <Home />
          </Route>
          <Route path="/about">
            <About />
          </Route>
          <Route path="/dashboard">
            <Dashboard />
          </Route>
          <Route path="/signin">
            <SignIn />
          </Route>
        </Switch>
    </Router>
    </Provider>
    </FirebaseAppProvider>
  </React.StrictMode>
);
</code>```

Body:
For some reason, I can't get my SignIn page to render when I click it on the Navbar. The route effectively changes to http://localhost:3000/signin, and that route is set up correctly to render my SignIn component, but the Home page stays the same and the SignIn button changes to "loading...". I'm using google authentication for the SignIn component, and I'm using an AuthCheck fallback and Suspense fallback in my Navbar.

NAVBAR CODE:

import React, { Suspense } from "react";
import { makeStyles } from "@material-ui/core/styles";
import AppBar from "@material-ui/core/AppBar";
import Toolbar from "@material-ui/core/Toolbar";
import Typography from "@material-ui/core/Typography";
import Button from "@material-ui/core/Button";
import Logo from '../assets/images/basketball.png';
import { Link } from 'react-router-dom';
import {AuthCheck} from 'reactfire'

const useStyles = makeStyles((theme) => ({
  root: {
    flexGrow: 1,
  },
  menuButton: {
    marginRight: theme.spacing(2),
  },
  title: {
    flexGrow: 1,
  },
  logo: {
    height: "50px",
  },
  link: {
    color: "black",
    textDecoration: "none",
    },
    }));

export const Navbar = () => {
  const classes = useStyles();

  return (

      <AppBar position="static">
        <Toolbar style={{ alignItems: "center", justifyContent: "center", backgroundColor: "rgb(0, 255, 225)" }}>
          <Link to="/">

          </Link>
          <Typography style={{flexDirection: 'column', display: 'flex', alignItems: 'center', justifyContent: 'center', color: 'black' }} variant="h2" className={classes.title}>
            NBA Stat Reference
          </Typography>
          <Suspense fallback={'loading...'}>
          <AuthCheck fallback={
          <Button style={{color: "black"}}>
              <Link className={classes.link} to="/signin">Sign In</Link>
          </Button>
          }>
          <Button color="black">
            <Link className={classes.link} to="/">Home</Link>
          </Button>
          <Button color="black">
            <Link className={classes.link} to="/dashboard">Dashboard</Link>
          </Button>
          <Button color="black">
            <Link className={classes.link} to="/about">About</Link>
          </Button>
          </AuthCheck>
          </Suspense>
        </Toolbar>
      </AppBar>

  );
}

SIGN IN CODE:

import React, { useState } from 'react'
import firebase from 'firebase/app';
import { AuthCheck, useAuth } from 'reactfire';
import 'firebase/auth';
import { Input } from './Input';
import { Container, Button, makeStyles, Typography, Snackbar,  } from '@material-ui/core';
import { withRouter } from "react-router-dom";
import MuiAlert from '@material-ui/lab/Alert';
import { Navbar } from './Navbar'

const Alert = (props) => {
  return <MuiAlert elevation={6} variant="filled" {...props} />
}

const useStyles = makeStyles({
    googleButton:{
        backgroundColor: 'rgb(66,133,244)',
        marginTop: '2em',
        padding: '0',
        color: 'white',
        height: '50px',
        width: '240px',
        border: 'none',
        textAlign: 'center',
        boxShadow: 'rgb(0 0 0 / 25%) 0px 2px 4px 0px',
        fontSize: '16px',
        lineHeight: '48px',
        display: 'block',
        borderRadius: '1px',
        fontFamily: 'Roboto, arial, sans-serif',
        cursor: 'pointer'
    },
    googleLogo:{
        width: '48px',
        height: '48px',
        display: 'block'
    },
    typographyStyle: {
        fontFamily: 'Roboto, arial, sans-serif;',
        textAlign: 'center',
        fontSize: '2em'
    },
    containerStyle: {
        marginTop: '2em'
    },
    snackBar: {
        color: 'white',
        backgroundColor: '#4caf50'
    }
});

export const SignIn = withRouter((props) => {
  const auth = useAuth();
  const classes = useStyles();
  const { history } = props;
  const [open, setOpen] = useState(false);

    const handleSnackOpen = () => {
        setOpen(true)
    };

    const handleSnackClose = (event, reason) => {
      if (reason === "clickaway") {
      return;
      }

      setOpen(false);
      history.push("/");
      };

    const sign_in = async () => {
        const response = await auth.signInWithPopup( new firebase.auth.GoogleAuthProvider());
        if(response.user){
            handleSnackOpen();
        }
    };

    const sign_out = async () => {
        await auth.signOut();
    }

    return (

            <Navbar />
            <Container maxWidth = 'sm' className={classes.containerStyle}>
                <Typography className={classes.typographyStyle}>Sign In Below</Typography>
                <form>

                        Email
                        <Input name="email" placeholder="Place Email Here" />

                        Password
                        <Input name="password" placeholder="Place Password Here" />

                    <Button type="submit" variant='contained' color='primary'>Submit</Button>
                </form>

                <AuthCheck fallback={
                    <Button className={classes.googleButton} onClick={sign_in}>Sign In With Google</Button>
                }>
                    <Button variant='contained' color='secondary' onClick={sign_out}>Sign Out</Button>
                </AuthCheck>
                <Snackbar message={'Success'} open={open} autoHideDuration={6000} onClose={handleSnackClose}>
                    <Alert onClose={handleSnackClose} severity="success">
                        Successful Sign In - Redirect in 6 seconds
                    </Alert>
                </Snackbar>
            </Container>

    )
});

INDEX.JS (ROUTES)

import React from 'react';
import ReactDOM from 'react-dom';
import {Home} from './client/components/Home';
import {About} from './client/components/About';
import {Dashboard} from './client/components/Dashboard';
import {SignIn} from './client/components/SignIn'
import './index.css'
import {
  BrowserRouter as Router,
  Route,
  Switch
} from "react-router-dom";
import {firebaseConfig} from './firebaseConfig';
import {FirebaseAppProvider, AuthCheck} from 'reactfire';
import 'firebase/auth';
import {Provider} from 'react-redux';
import {store} from './client/Redux/store';
import * as ReactDOMClient from 'react-dom/client';

const root = ReactDOMClient.createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <FirebaseAppProvider firebaseConfig={firebaseConfig} suspense={true}>
    <Provider store={store}>

      <Router>
        <Switch>
          <Route exact path="/">
            <Home />
          </Route>
          <Route path="/about">
            <About />
          </Route>
          <Route path="/dashboard">
            <Dashboard />
          </Route>
          <Route path="/signin">
            <SignIn />
          </Route>
        </Switch>
    </Router>
    </Provider>
    </FirebaseAppProvider>
  </React.StrictMode>
);