问:
Nothing is displayed on the page after running npm start
I am currently on the backend of my software which runs via electron but I can't get the data. So I tried to retrieve the data from a python program that sends it using Flask, but when I run the npm start command, nothing is displayed. I would also like to be able to run the program via electron but when I run the command npm run electron:start nothing happens either.

Here are the JS, Python code:

JS :

```<code>import React from "react";

class Home extends React.Component {
    constructor() {
        super();
        this.hello = require("child_process").spawn("python", ["./hello.py"]);
        this.state = { fs_s5: 12 };
        this.hello.stdout.on('data', (data) => {
          this.setState({ fs_s5: data });
        });
    }
    render(){
        return(
        <div>
            <div class="home">
                <div class="template-1" id="temp1">
                <div class="panel-1">
                    <div class="panel-header">
                    <h1>Panel 1</h1>
                    <i class='bx bx-cog modal-trigger-panel'></i>
                    </div>
                    <div class="panel-body">
                    <div class="sec-5 modal-trigger-data" id="hs-sec-5">
                        <span class="h1" id="h1-fs-s5">{this.state.fs_s5}</span>
                        <h2>TWIST</h2>
                        <h3>s5</h3>
                    </div>
                    <div class="sec-4 modal-trigger-data" id="hs-sec-4">
                        <h1>--</h1>
                        <h2>TWIST</h2>
                        <h3>s4</h3>
                    </div>
                    <div class="sec-3 modal-trigger-data" id="hs-sec-3">
                        <h1>--</h1>
                        <h2>TWIST</h2>
                        <h3>s3</h3>
                    </div>
                    <div class="sec-2 modal-trigger-data" id="hs-sec-2">
                        <h1>--</h1>
                        <h2>TWIST</h2>
                        <h3>s2</h3>
                    </div>
                    <div class="sec-1 modal-trigger-data" id="hs-sec-1">
                        <h1>--</h1>
                        <h2>TWIST</h2>
                        <h3>s1</h3>
                    </div>
                    </div>
                </div>
                </div>
            </div>
        </div>
        );
    }
}

export default Home;
</code>```

Python :

```<code>from __future__ import print_function
import time
from flask import Flask

app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World! This is powered by Python backend."

if __name__ == "__main__":
   print(12)
   time.sleep(5)
   app.run(host='127.0.0.1', port=5000)
</code>```

Package.json :

```<code>{
  "name": "react-electron",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "child_process": "^1.0.2",
    "electron-is-dev": "^2.0.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-scripts": "5.0.1",
    "web-vitals": "^2.1.4"
  },
  "main": "public/main.js",
  "homepage": "./",
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "package": "electron-forge package",
    "make": "electron-forge make",
    "electron:serve": "concurrently -k \"cross-env BROWSER=none yarn start\" \"yarn electron:start\"",
    "electron:build": "yarn build && electron-builder -c.extraMetadata.main=build/main.js",
    "electron:start": "wait-on tcp:3001 && electron ."
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "browser": {
    "child_process": false
  }
}
</code>```

Test :

For each test I performed, no software window opened.

First, I tested to use HTTP to send data from my python program to the .js program with the following code parts but no data was sent since when I tried to go to the following address http://127.0.0.1:5000 the connection failed:

JS:

```<code>  constructor() {
    super();
    this.state = { data: [] };
  }

  componentDidMount() {
    axios.get('http://localhost:5000/api/data')
      .then(response => this.setState({ data: response.data }));
  }
</code>```

Python:

```<code>from flask import Flask, jsonify

app = Flask(__name__)

@app.route('/api/data')
def get_data():
  data = [1, 2, 3, 4, 5]
  return jsonify(data)

if __name__ == '__main__':
  app.run(host='127.0.0.1', port=5000)
</code>```

On the other hand, when I went to the address http:localhost:3000 the GUI was displayed but without the data in the corresponding box.

Secondly, I tested to retrieve the data through the stdout() function with the following code:

JS:

```<code>    constructor() {
        super();
        this.hello = require("child_process").spawn("python", ["./hello.py"]);
        this.state = { fs_s5: 12 };
        this.hello.stdout.on('data', (data) => {
          this.setState({ fs_s5: data });
        });
    }
</code>```

Python:

```<code>from __future__ import print_function
print(1)
</code>```

But I had a failed connection for the URL: 'http://127.0.0.1:5000' and nothing for the URL 'http://localhost:3000'

So, I would like the python program to send the same list of data continuously to the React program.

Regards,

Body:
I am currently on the backend of my software which runs via electron but I can't get the data. So I tried to retrieve the data from a python program that sends it using Flask, but when I run the npm start command, nothing is displayed. I would also like to be able to run the program via electron but when I run the command npm run electron:start nothing happens either.

Here are the JS, Python code:

JS :

import React from "react";

class Home extends React.Component {
    constructor() {
        super();
        this.hello = require("child_process").spawn("python", ["./hello.py"]);
        this.state = { fs_s5: 12 };
        this.hello.stdout.on('data', (data) => {
          this.setState({ fs_s5: data });
        });
    }
    render(){
        return(

Panel 1

                        {this.state.fs_s5}

TWIST

s5

--

TWIST

s4

--

TWIST

s3

--

TWIST

s2

--

TWIST

s1

        );
    }
}

export default Home;

Python :

from __future__ import print_function
import time
from flask import Flask

app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World! This is powered by Python backend."

if __name__ == "__main__":
   print(12)
   time.sleep(5)
   app.run(host='127.0.0.1', port=5000)

Package.json :

{
  "name": "react-electron",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "child_process": "^1.0.2",
    "electron-is-dev": "^2.0.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-scripts": "5.0.1",
    "web-vitals": "^2.1.4"
  },
  "main": "public/main.js",
  "homepage": "./",
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "package": "electron-forge package",
    "make": "electron-forge make",
    "electron:serve": "concurrently -k \"cross-env BROWSER=none yarn start\" \"yarn electron:start\"",
    "electron:build": "yarn build && electron-builder -c.extraMetadata.main=build/main.js",
    "electron:start": "wait-on tcp:3001 && electron ."
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "browser": {
    "child_process": false
  }
}

Test :

For each test I performed, no software window opened.

First, I tested to use HTTP to send data from my python program to the .js program with the following code parts but no data was sent since when I tried to go to the following address http://127.0.0.1:5000 the connection failed:

JS:

  constructor() {
    super();
    this.state = { data: [] };
  }

  componentDidMount() {
    axios.get('http://localhost:5000/api/data')
      .then(response => this.setState({ data: response.data }));
  }

Python:

from flask import Flask, jsonify

app = Flask(__name__)

@app.route('/api/data')
def get_data():
  data = [1, 2, 3, 4, 5]
  return jsonify(data)

if __name__ == '__main__':
  app.run(host='127.0.0.1', port=5000)

On the other hand, when I went to the address http:localhost:3000 the GUI was displayed but without the data in the corresponding box.

Secondly, I tested to retrieve the data through the stdout() function with the following code:

JS:

    constructor() {
        super();
        this.hello = require("child_process").spawn("python", ["./hello.py"]);
        this.state = { fs_s5: 12 };
        this.hello.stdout.on('data', (data) => {
          this.setState({ fs_s5: data });
        });
    }

Python:

from __future__ import print_function
print(1)

But I had a failed connection for the URL: 'http://127.0.0.1:5000' and nothing for the URL 'http://localhost:3000'

So, I would like the python program to send the same list of data continuously to the React program.

Regards,


来源: stackexchange

问:
Microsoft Clarity: Meaning of *Other* in Devices section
This is from MS Clarity from the Insights Dashboard section.

Any idea what this Other is? It shouldn't be tablet since those are reported as a separate line item.

ContentLicense: CC BY-SA 4.0


问:
PowerShell for automation Maven build and eclipse
Hi I want to create automation script using PowerShell can anyone help me in this ?
Changes for Parent POM.XML: -

I have created below code to update group Id with .eclipse extension in my pom.xml.
for Example, if I consider my group-Id as "hello" I want to replace it by hello.eclipse

$FileContent = Get-ChildItem "C:\Users\Documents\example\pom.xml" | Get-Content $FileContent <# #> $NewFileContent = @() for ($i = 0; $i -lt $FileContent.length; $i++) { if ($FileContent[$i] -like "groupId") { $NewFileContent += ".eclipse" } $NewFileContent += $FileContent[$i] } $NewFileContent | Out-File "C:\Users\Documents\example\pom.xml" Get-ChildItem "C:\Users\Documents\example\pom.xml" | Get-Content


问:
message headers lost in Kafka
Main question: While everything works on my setup, I mean producing and consuming messages work with messages and keys, but message headers are not received on the consumer side, is there any specific configuration for allowing message headers on a Kafka cluster?

I'm using a laravel kafka package, everything is working just fine, I have a producer and a consumer both with Laravel and the mentioned package, and for the Kafka I'm using bitnami/kafka docker image. and everything works just fine. I can produce messages on a topic and successfully receive them on the consumer side.

Yet, the weird thing is that on the consumer side the headers are not available. it's lost somehow but I can get the message itself and the key and everything else.

```<code>$message = new Message(
        body: [
            'name' => 'test',
        ],
        headers: [
            'anotherName' => 'test',
        ],
        key: '1'
    );

Kafka::publishOn($topic)->withMessage($message)
</code>```

I have also tested other methods mentioned in the docs, such as withHeaders(), still not working.

I'm suspicious that there is something wrong with my Kafka setup, is there any specific change needed to be applied on Kafka for having headers on the messages?

Title: message headers lost in Kafka

Body:
Main question: While everything works on my setup, I mean producing and consuming messages work with messages and keys, but message headers are not received on the consumer side, is there any specific configuration for allowing message headers on a Kafka cluster?

I'm using a laravel kafka package, everything is working just fine, I have a producer and a consumer both with Laravel and the mentioned package, and for the Kafka I'm using bitnami/kafka docker image. and everything works just fine. I can produce messages on a topic and successfully receive them on the consumer side.

Yet, the weird thing is that on the consumer side the headers are not available. it's lost somehow but I can get the message itself and the key and everything else.

$message = new Message(
        body: [
            'name' => 'test',
        ],
        headers: [
            'anotherName' => 'test',
        ],
        key: '1'
    );

Kafka::publishOn($topic)->withMessage($message)

I have also tested other methods mentioned in the docs, such as withHeaders(), still not working.

I'm suspicious that there is something wrong with my Kafka setup, is there any specific change needed to be applied on Kafka for having headers on the messages?


问:
<=> operator for OpenCV type: binary '<': no operator found which takes a left-hand operand of type 'const _Ty' (or there is no acceptable conversion)
I want a function to return an std::set of cv::Point3d, this means an implementation of < is required (no operator "<" matches these operands error), so i implemented the <=> operator for the generic type cv::Point3_, however I am still getting a binary '<': no operator found which takes a left-hand operand of type 'const _Ty' (or there is no acceptable conversion) error.

While I managed to compile an implementation for a custom type:

```<code>#include <iostream>
#include <compare>
#include <tuple>
#include <set>
#include <vector>
#include <algorithm>

template<typename _Tp> class Point3_
{
public:

   Point3_(_Tp _x, _Tp _y, _Tp _z);

   _Tp x;
   _Tp y;
   _Tp z;
};

template<typename _Tp> inline
Point3_<_Tp>::Point3_(_Tp _x, _Tp _y, _Tp _z)
   : x(_x), y(_y), z(_z) {}

// Function definition for 'operator<=>' not found warning.
template<typename _Tp> std::partial_ordering operator<=>(const Point3_<_Tp>& pt1, const Point3_<_Tp>& pt2);

template<typename _Tp> inline std::partial_ordering operator<=>(const Point3_<_Tp>& pt1, const Point3_<_Tp>& pt2)
{
   auto as_tie = [](const Point3_<_Tp>& pt) { return std::tie(pt.x, pt.y, pt.z); };
   return as_tie(pt1) <=> as_tie(pt2);
}

int main()
{

   auto a = Point3_<double>(-.1, -.1, -.1);
   auto b = Point3_<double>(.1, .1, .1);
   auto c = Point3_<double>(.2, .2, .2);

   std::set<Point3_<double>> dset;
   std::vector<Point3_<double>> dvec = { a, b, c };

   std::ranges::copy_if(dvec.begin(), dvec.end(), std::inserter(dset, dset.begin()), [](auto p) { return p.x > 0; });

   std::cout << "(-.1, -.1, -.1) < (.1, .1, .1) is " << (a < b ? "true" : "false") << std::endl << "The set contains: ";
   for (auto& pt : dset)
   {
      std::cout << " (" << pt.x << " " << pt.y << " " << pt.z << ")";
   }
   std::cout << std::endl;

}
</code>```

It does not compile for the desired type (error mentioned above):

```<code>#include <iostream>
#include <compare>
#include <tuple>
#include <set>
#include <vector>
#include <algorithm>
#include <opencv2/opencv.hpp>

// Function definition for 'operator<=>' not found warning.
template<typename _Tp>
std::partial_ordering operator<=>(const cv::Point3_<_Tp>& pt1, const cv::Point3_<_Tp>& pt2);

template<typename _Tp>
inline std::partial_ordering operator<=>(const cv::Point3_<_Tp>& pt1, const cv::Point3_<_Tp>& pt2)
{
   auto as_tie = [](const cv::Point3_<_Tp>& pt) { return std::tie(pt.x, pt.y, pt.z); };
   return as_tie(pt1) <=> as_tie(pt2);
}

int main()
{

   auto a = cv::Point3_<double>(-.1, -.1, -.1);
   auto b = cv::Point3_<double>(.1, .1, .1);
   auto c = cv::Point3_<double>(.2, .2, .2);

   std::set<cv::Point3_<double>> dset;
   std::vector<cv::Point3_<double>> dvec = { a, b, c };

   std::ranges::copy_if(dvec.begin(), dvec.end(), std::inserter(dset, dset.begin()), [](auto p) { return p.x > 0; });

   std::cout << "(-.1, -.1, -.1) < (.1, .1, .1) is " << (a < b ? "true" : "false") << std::endl << "The set contains: ";
   for (auto& pt : dset)
   {
      std::cout << " (" << pt.x << " " << pt.y << " " << pt.z << ")";
   }
   std::cout << std::endl;

}
</code>```

OpenCV version: 4.6.0 (installed with vcpkg)

Compiler: MSVC, default compiler options bundled with VS2022. Only the C++ Language Standard option has been changed (to C++20).

Body:
I want a function to return an std::set of cv::Point3d, this means an implementation of < is required (no operator "<" matches these operands error), so i implemented the <=> operator for the generic type cv::Point3_, however I am still getting a binary '<': no operator found which takes a left-hand operand of type 'const _Ty' (or there is no acceptable conversion) error.

While I managed to compile an implementation for a custom type:

#include <iostream>
#include <compare>
#include <tuple>
#include <set>
#include <vector>
#include <algorithm>

template<typename _Tp> class Point3_
{
public:

   Point3_(_Tp _x, _Tp _y, _Tp _z);

   _Tp x;
   _Tp y;
   _Tp z;
};

template<typename _Tp> inline
Point3_<_Tp>::Point3_(_Tp _x, _Tp _y, _Tp _z)
   : x(_x), y(_y), z(_z) {}

// Function definition for 'operator<=>' not found warning.
template<typename _Tp> std::partial_ordering operator<=>(const Point3_<_Tp>& pt1, const Point3_<_Tp>& pt2);

template<typename _Tp> inline std::partial_ordering operator<=>(const Point3_<_Tp>& pt1, const Point3_<_Tp>& pt2)
{
   auto as_tie = [](const Point3_<_Tp>& pt) { return std::tie(pt.x, pt.y, pt.z); };
   return as_tie(pt1) <=> as_tie(pt2);
}

int main()
{

   auto a = Point3_<double>(-.1, -.1, -.1);
   auto b = Point3_<double>(.1, .1, .1);
   auto c = Point3_<double>(.2, .2, .2);

   std::set<Point3_<double>> dset;
   std::vector<Point3_<double>> dvec = { a, b, c };

   std::ranges::copy_if(dvec.begin(), dvec.end(), std::inserter(dset, dset.begin()), [](auto p) { return p.x > 0; });

   std::cout << "(-.1, -.1, -.1) < (.1, .1, .1) is " << (a < b ? "true" : "false") << std::endl << "The set contains: ";
   for (auto& pt : dset)
   {
      std::cout << " (" << pt.x << " " << pt.y << " " << pt.z << ")";
   }
   std::cout << std::endl;

}

It does not compile for the desired type (error mentioned above):

#include <iostream>
#include <compare>
#include <tuple>
#include <set>
#include <vector>
#include <algorithm>
#include <opencv2/opencv.hpp>

// Function definition for 'operator<=>' not found warning.
template<typename _Tp>
std::partial_ordering operator<=>(const cv::Point3_<_Tp>& pt1, const cv::Point3_<_Tp>& pt2);

template<typename _Tp>
inline std::partial_ordering operator<=>(const cv::Point3_<_Tp>& pt1, const cv::Point3_<_Tp>& pt2)
{
   auto as_tie = [](const cv::Point3_<_Tp>& pt) { return std::tie(pt.x, pt.y, pt.z); };
   return as_tie(pt1) <=> as_tie(pt2);
}

int main()
{

   auto a = cv::Point3_<double>(-.1, -.1, -.1);
   auto b = cv::Point3_<double>(.1, .1, .1);
   auto c = cv::Point3_<double>(.2, .2, .2);

   std::set<cv::Point3_<double>> dset;
   std::vector<cv::Point3_<double>> dvec = { a, b, c };

   std::ranges::copy_if(dvec.begin(), dvec.end(), std::inserter(dset, dset.begin()), [](auto p) { return p.x > 0; });

   std::cout << "(-.1, -.1, -.1) < (.1, .1, .1) is " << (a < b ? "true" : "false") << std::endl << "The set contains: ";
   for (auto& pt : dset)
   {
      std::cout << " (" << pt.x << " " << pt.y << " " << pt.z << ")";
   }
   std::cout << std::endl;

}

OpenCV version: 4.6.0 (installed with vcpkg)

Compiler: MSVC, default compiler options bundled with VS2022. Only the C++ Language Standard option has been changed (to C++20).


问:
Setting up slots in story using Rasa v3
Using the rasa documentation, I have included a few slots and entities in my domain.yml file.

```<code>domain.yml
entities:
  - cuisine
  - bot
  - PERSON
  - GPE
  - topic
  - DATE
  - month
  - ORDINAL
  - body_part
  - motor_action
  - direction
  - botname
  - username
  - country

slots:
  DATE:
    type: text
    mappings:
      - type: from_entity
        entity: DATE

  GPE:
    type: text
    mappings:
      - type: from_entity
        entity: GPE

  PERSON:
    type: text
    mappings:
      - type: from_entity
        entity: PERSON

  bot:
    type: categorical
    values:
      - alexa
      - google assistant
      - cortana
    mappings:
      - type: from_entity
        entity: bot

  botname:
    type: categorical
    values:
      - Albert
    mappings:
      - type: from_entity
        entity: botname

  month:
    type: categorical
    values:
      - january
      - february
      - march
      - april
      - may
      - june
      - july
      - august
      - september
      - october
      - november
      - december
    mappings:
      - type: from_entity
        entity: month

  topic:
    type: text
    mappings:
      - type: from_entity
        entity: topic

  username:
    type: text
    initial_value: human
    mappings:
      - type: from_entity
        entity: username
</code>```

A snippet from my story.yml file

```<code>version: "3.1"

stories:
    - story: user asks for days in month
    steps:
      - intent: ask_days_in_month
        entities:
          - month: "January"
      - slot_was_set:
          - month: "January"
      - action: action_get_daysinmonth
</code>```

Upon running rasa train, i come across the following error

```<code>Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\www\bot\venv\Scripts\rasa.exe\__main__.py", line 7, in <module>
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\__main__.py", line 126, in main
    cmdline_arguments.func(cmdline_arguments)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\cli\train.py", line 62, in <lambda>
    train_parser.set_defaults(func=lambda args: run_training(args, can_exit=True))
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\cli\train.py", line 94, in run_training
    training_result = train_all(
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\api.py", line 105, in train
    return train(
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\model_training.py", line 120, in train
    stories = file_importer.get_stories()
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\importers\importer.py", line 492, in get_stories
    return self.importer.get_stories(exclusion_percentage)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\importers\importer.py", line 418, in get_stories
    return self._importer.get_stories(exclusion_percentage)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\utils\common.py", line 145, in decorated
    to_cache = f(self, *args, **kwargs)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\importers\importer.py", line 275, in get_stories
    stories = [
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\importers\importer.py", line 276, in <listcomp>
    importer.get_stories(exclusion_percentage) for importer in self._importers
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\importers\rasa.py", line 60, in get_stories
    return utils.story_graph_from_paths(
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\importers\utils.py", line 21, in story_graph_from_paths
    story_steps = loading.load_data_from_files(files, domain, exclusion_percentage)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\loading.py", line 80, in load_data_from_files
    steps = reader.read_from_file(story_file)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 106, in read_from_file
    return self.read_from_string(
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 134, in read_from_string
    return self.read_from_parsed_yaml(yaml_content)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 159, in read_from_parsed_yaml
    parser.parse_data(data)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 227, in parse_data
    self._parse_plain_item(item)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 257, in _parse_plain_item
    self._parse_step(step)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 290, in _parse_step
    self._parse_slot(step)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 505, in _parse_slot
    SlotSet.type_name, {slot: self._slot_default_value(slot)}
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 526, in _slot_default_value
    slot = next(slot for slot in self.domain.slots if slot.name == slot_name)
StopIteration
</code>```

I have searched the rasa forum and stackoverflow and came across a few solutions but they are a mix of Rasa V2 and Rasa V3 snippets which is quite confusing. I am new to Rasa and i am doing something wrong, i just need help figuring out what it is.

Title: Setting up slots in story using Rasa v3

Body:
Using the rasa documentation, I have included a few slots and entities in my domain.yml file.

domain.yml
entities:
  - cuisine
  - bot
  - PERSON
  - GPE
  - topic
  - DATE
  - month
  - ORDINAL
  - body_part
  - motor_action
  - direction
  - botname
  - username
  - country

slots:
  DATE:
    type: text
    mappings:
      - type: from_entity
        entity: DATE

  GPE:
    type: text
    mappings:
      - type: from_entity
        entity: GPE

  PERSON:
    type: text
    mappings:
      - type: from_entity
        entity: PERSON

  bot:
    type: categorical
    values:
      - alexa
      - google assistant
      - cortana
    mappings:
      - type: from_entity
        entity: bot

  botname:
    type: categorical
    values:
      - Albert
    mappings:
      - type: from_entity
        entity: botname

  month:
    type: categorical
    values:
      - january
      - february
      - march
      - april
      - may
      - june
      - july
      - august
      - september
      - october
      - november
      - december
    mappings:
      - type: from_entity
        entity: month

  topic:
    type: text
    mappings:
      - type: from_entity
        entity: topic

  username:
    type: text
    initial_value: human
    mappings:
      - type: from_entity
        entity: username

A snippet from my story.yml file

version: "3.1"

stories:
    - story: user asks for days in month
    steps:
      - intent: ask_days_in_month
        entities:
          - month: "January"
      - slot_was_set:
          - month: "January"
      - action: action_get_daysinmonth

Upon running rasa train, i come across the following error

Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\www\bot\venv\Scripts\rasa.exe\__main__.py", line 7, in <module>
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\__main__.py", line 126, in main
    cmdline_arguments.func(cmdline_arguments)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\cli\train.py", line 62, in <lambda>
    train_parser.set_defaults(func=lambda args: run_training(args, can_exit=True))
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\cli\train.py", line 94, in run_training
    training_result = train_all(
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\api.py", line 105, in train
    return train(
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\model_training.py", line 120, in train
    stories = file_importer.get_stories()
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\importers\importer.py", line 492, in get_stories
    return self.importer.get_stories(exclusion_percentage)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\importers\importer.py", line 418, in get_stories
    return self._importer.get_stories(exclusion_percentage)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\utils\common.py", line 145, in decorated
    to_cache = f(self, *args, **kwargs)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\importers\importer.py", line 275, in get_stories
    stories = [
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\importers\importer.py", line 276, in <listcomp>
    importer.get_stories(exclusion_percentage) for importer in self._importers
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\importers\rasa.py", line 60, in get_stories
    return utils.story_graph_from_paths(
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\importers\utils.py", line 21, in story_graph_from_paths
    story_steps = loading.load_data_from_files(files, domain, exclusion_percentage)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\loading.py", line 80, in load_data_from_files
    steps = reader.read_from_file(story_file)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 106, in read_from_file
    return self.read_from_string(
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 134, in read_from_string
    return self.read_from_parsed_yaml(yaml_content)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 159, in read_from_parsed_yaml
    parser.parse_data(data)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 227, in parse_data
    self._parse_plain_item(item)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 257, in _parse_plain_item
    self._parse_step(step)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 290, in _parse_step
    self._parse_slot(step)
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 505, in _parse_slot
    SlotSet.type_name, {slot: self._slot_default_value(slot)}
  File "c:\program files\www\bot\venv\lib\site-packages\rasa\shared\core\training_data\story_reader\yaml_story_reader.py", line 526, in _slot_default_value
    slot = next(slot for slot in self.domain.slots if slot.name == slot_name)
StopIteration

I have searched the rasa forum and stackoverflow and came across a few solutions but they are a mix of Rasa V2 and Rasa V3 snippets which is quite confusing. I am new to Rasa and i am doing something wrong, i just need help figuring out what it is.


问:
Flutter terminate loop when new one starts
I have a list called songs. I want to perform some action on songs and save them in another list OtherSongs.
Here is an example:

```<code>Class SongClass{
    List songs = [
      {//song 1},
      {//Song 2},
      ...
    ];
    List otherSongs = [];

    doSomething(){
        otherSongs.clear();
        for(var item in songs){
           // fetch detail of song from internet
           OtherSongs.add(item);
        }
    }
}
</code>```

what I want to do is when I call doSomething() it starts loop which fetches data from internet. It clearly would take time to complete. but if doSomething() is called again before completing, I want previous loop to stop and then start new one.

Body:
I have a list called songs. I want to perform some action on songs and save them in another list OtherSongs.
Here is an example:

Class SongClass{
    List songs = [
      {//song 1},
      {//Song 2},
      ...
    ];
    List otherSongs = [];

    doSomething(){
        otherSongs.clear();
        for(var item in songs){
           // fetch detail of song from internet
           OtherSongs.add(item);
        }
    }
}

what I want to do is when I call doSomething() it starts loop which fetches data from internet. It clearly would take time to complete. but if doSomething() is called again before completing, I want previous loop to stop and then start new one.


问:
Why does SetSchemaMetadata SMT work for $Value but not for $Key in my Kafka Connect connector?
I've tried for a few hours to find out why the SetSchemaMetadata SMT works for my value but not for my key even though Kafka Connect detects that the SMT plugin exists for the key (i.e no error). I have also set auto.register.schemas to true to see what schema it generates in the schema registry and the value schema has the correct namespace but the key schema has the default values (i.e. not being set by the SMT).

Here are my connector configs:

```<code> '{
        "connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
        "value.converter.schema.registry.url": "http://schema-registry:8081",
        "value.converter": "io.confluent.connect.avro.AvroConverter",
        "key.converter.schema.registry.url": "http://schema-registry:8081",
        "key.converter": "io.confluent.connect.avro.AvroConverter",
        "connection.url": "jdbc:postgresql://host.docker.internal:5432/db_name",
        "connection.user": "postgres",
        "connection.password": "12345",
        "table.whitelist": "file",
        "mode": "timestamp+incrementing",
        "incrementing.column.name": "seq",
        "timestamp.column.name": "last_modified_datetime",
        "topic.prefix": "jdbc-source-inserted_or_updated_",
        "validate.non.null": true,
        "timestamp.granularity": "nanos_long",
        "poll.interval.ms": "100",
        "auto.register.schemas": "true",
        "transforms": "AddNamespaceForKey, AddNamespaceForValue, copyFieldToKey",
        "transforms.AddNamespaceForKey.type": "org.apache.kafka.connect.transforms.SetSchemaMetadata$Key",
        "transforms.AddNamespaceForKey.schema.name": "io.JDBC_Source_Inserted_Or_Updated_File_Key.JDBC_Source_Inserted_Or_Updated_File_Key",
        "transforms.AddNamespaceForValue.type": "org.apache.kafka.connect.transforms.SetSchemaMetadata$Value",
        "transforms.AddNamespaceForValue.schema.name": "io.JDBC_Source_Inserted_Or_Updated_File_Value.JDBC_Source_Inserted_Or_Updated_File_Value",
        "transforms.copyFieldToKey.type":"org.apache.kafka.connect.transforms.ValueToKey",
        "transforms.copyFieldToKey.fields":"name",
        "errors.log.enable":true,
        "errors.log.include.messages":true
     }'
</code>```

Here are the generated schemas:

Key:

```<code>{
  "fields": [
    {
      "name": "name",
      "type": "string"
    }
  ],
  "name": "ConnectDefault",
  "namespace": "io.confluent.connect.avro",
  "type": "record"
}
</code>```

Value:

```<code>{
  "connect.name": "io.JDBC_Source_Inserted_Or_Updated_File_Value.JDBC_Source_Inserted_Or_Updated_File_Value",
  "fields": [
    {
      "name": "seq",
      "type": "int"
    },
    {
      "name": "name",
      "type": "string"
    },
    {
      "name": "url",
      "type": "string"
    },
    {
      "name": "last_modified_datetime",
      "type": "long"
    },
    {
      "name": "modified_at",
      "type": "long"
    },
    {
      "name": "created_at",
      "type": "long"
    }
  ],
  "name": "JDBC_Source_Inserted_Or_Updated_File_Value",
  "namespace": "io.JDBC_Source_Inserted_Or_Updated_File_Value",
  "type": "record"
}
</code>```

Body:
I've tried for a few hours to find out why the SetSchemaMetadata SMT works for my value but not for my key even though Kafka Connect detects that the SMT plugin exists for the key (i.e no error). I have also set auto.register.schemas to true to see what schema it generates in the schema registry and the value schema has the correct namespace but the key schema has the default values (i.e. not being set by the SMT).

Here are my connector configs:

 '{
        "connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
        "value.converter.schema.registry.url": "http://schema-registry:8081",
        "value.converter": "io.confluent.connect.avro.AvroConverter",
        "key.converter.schema.registry.url": "http://schema-registry:8081",
        "key.converter": "io.confluent.connect.avro.AvroConverter",
        "connection.url": "jdbc:postgresql://host.docker.internal:5432/db_name",
        "connection.user": "postgres",
        "connection.password": "12345",
        "table.whitelist": "file",
        "mode": "timestamp+incrementing",
        "incrementing.column.name": "seq",
        "timestamp.column.name": "last_modified_datetime",
        "topic.prefix": "jdbc-source-inserted_or_updated_",
        "validate.non.null": true,
        "timestamp.granularity": "nanos_long",
        "poll.interval.ms": "100",
        "auto.register.schemas": "true",
        "transforms": "AddNamespaceForKey, AddNamespaceForValue, copyFieldToKey",
        "transforms.AddNamespaceForKey.type": "org.apache.kafka.connect.transforms.SetSchemaMetadata$Key",
        "transforms.AddNamespaceForKey.schema.name": "io.JDBC_Source_Inserted_Or_Updated_File_Key.JDBC_Source_Inserted_Or_Updated_File_Key",
        "transforms.AddNamespaceForValue.type": "org.apache.kafka.connect.transforms.SetSchemaMetadata$Value",
        "transforms.AddNamespaceForValue.schema.name": "io.JDBC_Source_Inserted_Or_Updated_File_Value.JDBC_Source_Inserted_Or_Updated_File_Value",
        "transforms.copyFieldToKey.type":"org.apache.kafka.connect.transforms.ValueToKey",
        "transforms.copyFieldToKey.fields":"name",
        "errors.log.enable":true,
        "errors.log.include.messages":true
     }'

Here are the generated schemas:

Key:

{
  "fields": [
    {
      "name": "name",
      "type": "string"
    }
  ],
  "name": "ConnectDefault",
  "namespace": "io.confluent.connect.avro",
  "type": "record"
}

Value:

{
  "connect.name": "io.JDBC_Source_Inserted_Or_Updated_File_Value.JDBC_Source_Inserted_Or_Updated_File_Value",
  "fields": [
    {
      "name": "seq",
      "type": "int"
    },
    {
      "name": "name",
      "type": "string"
    },
    {
      "name": "url",
      "type": "string"
    },
    {
      "name": "last_modified_datetime",
      "type": "long"
    },
    {
      "name": "modified_at",
      "type": "long"
    },
    {
      "name": "created_at",
      "type": "long"
    }
  ],
  "name": "JDBC_Source_Inserted_Or_Updated_File_Value",
  "namespace": "io.JDBC_Source_Inserted_Or_Updated_File_Value",
  "type": "record"
}


问:
Unable to use Google Ink canvas library
I want to replicate the sketch functionality provided by chrome canvas in my own project.
I understand that Google uses their ink library for this purpose.

The reasons I want to use this library are:

Draws smooth lines for pencil/pen/marker

Provides very low latency for touch input

Provides ink-pen emulation

However I can't find any documentation for this library. How to compile and use this library in a web project?

Title: Unable to use Google Ink canvas library


问:
Is it possible/practical to host an SQLite or similar relational DB in AWS S3, accessed from Lambda+api gateway for low-traffic websites?
I am looking for access to a relational database that is "serverless" for use in a low traffic website where the API is via lambda + api gateway.

The objective being creating an end-to-end serverless application.

I have investigated Athena - however all documentation points to avoiding it's usage as a serverless database.

Could one host an SQLite DB in S3 and interact with it via a lambda function?


问:
How could I resolve this ERROR 1007 (HY000) mysql error
I come across a very weird problem and need your suggestions and help.
I run mysql from a docker container (percona 5.7). And I got below weird result:
So for now I'm unable to create the database nor drop it, how could I resolve this?

```<code>mysql> drop database digitalContent;
ERROR 1008 (HY000): Can't drop database 'digitalcontent'; database doesn't exist
mysql>  CREATE DATABASE  digitalContent;
ERROR 1007 (HY000): Can't create database 'digitalContent'; database exists
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| acl       |
| autobuilder                |
| automaker      |
| base            |
| binary            |
| cards              |
| decimals             |
| fho            |
| logs               |
| matrix             |
| matrix_with_tags   |
| maxmind            |
| memories           |
| messaging          |
| monsters        |
| mysql              |
| ppl_rank           |
| performance_schema |
| ppoints        |
| pros         |
| ps                 |
| users              |
| who          |
+--------------------+
24 rows in set (0.02 sec)
</code>```

I would like to create the database of "digitalContent", and know the reason why above doesn't work

Body:
I come across a very weird problem and need your suggestions and help.
I run mysql from a docker container (percona 5.7). And I got below weird result:
So for now I'm unable to create the database nor drop it, how could I resolve this?

mysql> drop database digitalContent;
ERROR 1008 (HY000): Can't drop database 'digitalcontent'; database doesn't exist
mysql>  CREATE DATABASE  digitalContent;
ERROR 1007 (HY000): Can't create database 'digitalContent'; database exists
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| acl       |
| autobuilder                |
| automaker      |
| base            |
| binary            |
| cards              |
| decimals             |
| fho            |
| logs               |
| matrix             |
| matrix_with_tags   |
| maxmind            |
| memories           |
| messaging          |
| monsters        |
| mysql              |
| ppl_rank           |
| performance_schema |
| ppoints        |
| pros         |
| ps                 |
| users              |
| who          |
+--------------------+
24 rows in set (0.02 sec)

I would like to create the database of "digitalContent", and know the reason why above doesn't work


问:
Word Templates not showing up in SharePoint/Teams after being added via PowerAutomate
I've been trying to setup a flow that automatically mirrors (read: copies and creates new) Word templates from one Teams Channel to another.
The goal is to have them appear in the "+ new"-dropdown in sharepoint and teams (see screenshot).
"+new"-dropdown in Teams

I believe I managed to find the path to the folder in which to put the template-file, which is: https://yourcompany.sharepoint.com/sites/YourSiteName/Freigegebene Dokumente/Forms
The "Freigegebene Dokumente" should be "shared documents" in english afaik.
Here comes the caveat:
When I upload a template-file via powerautomate, they do not show up in the "+ new"-dropdown. When I then try to manually add the same file via the "+ new"-dropdown, it tells me that a file with that name already exists.

Am I missing something? I fully expected this to just work.

What I am trying to get running so that the bigger solution can work is this:

Manually trigger a Microsoft PowerAutomate Cloudflow

Get information about a specific file in SharePoint (a .dotx MS-Word template)

Get the content of that specific file

Create a new File in the */Forms folder with the same name and content as seen in the screenshot.

Be able to create a new File in SharePoint (and Teams) from that template via the "+new"-dropdown

The two parameters used are:

```<code>@outputs('Dateieigenschaften_abrufen')?['body/{FilenameWithExtension}']
</code>```

and

```<code>@body('Dateiinhalt_abrufen')
</code>```

Screenshot of the flow

After running this flow, I expect to have a new template to choose from in the "+new"-dropdown in SharePoint. That is not the case.

I know that there is something uploaded, because if I try to manually add the template via the "+new"-dropdown

manual upload in "+new"-dropdown

I get this error message:

Error Message on manual upload

Body:
I've been trying to setup a flow that automatically mirrors (read: copies and creates new) Word templates from one Teams Channel to another.
The goal is to have them appear in the "+ new"-dropdown in sharepoint and teams (see screenshot).
"+new"-dropdown in Teams

I believe I managed to find the path to the folder in which to put the template-file, which is: https://yourcompany.sharepoint.com/sites/YourSiteName/Freigegebene Dokumente/Forms
The "Freigegebene Dokumente" should be "shared documents" in english afaik.
Here comes the caveat:
When I upload a template-file via powerautomate, they do not show up in the "+ new"-dropdown. When I then try to manually add the same file via the "+ new"-dropdown, it tells me that a file with that name already exists.

Am I missing something? I fully expected this to just work.

What I am trying to get running so that the bigger solution can work is this:

Manually trigger a Microsoft PowerAutomate Cloudflow

Get information about a specific file in SharePoint (a .dotx MS-Word template)

Get the content of that specific file

Create a new File in the */Forms folder with the same name and content as seen in the screenshot.

Be able to create a new File in SharePoint (and Teams) from that template via the "+new"-dropdown

The two parameters used are:

@outputs('Dateieigenschaften_abrufen')?['body/{FilenameWithExtension}']

and

@body('Dateiinhalt_abrufen')

Screenshot of the flow

After running this flow, I expect to have a new template to choose from in the "+new"-dropdown in SharePoint. That is not the case.

I know that there is something uploaded, because if I try to manually add the template via the "+new"-dropdown

manual upload in "+new"-dropdown

I get this error message:

Error Message on manual upload


问:
Spring Security OAuth2 XML configuration in detail
I want to use the XML configuration file for registering clients for OAuth2 in my web application. I know that there exist support for XML tags using the client-registrations tag.

However I want to register the client registration repository as a bean. So that it is extensible, something like this:

<beans:bean id="clientRegistrationRepository" class="org.springframework.security.oauth2.client.registration.ClientRegistrationRepository">
    <beans:constructor-arg index="0" ref="clientRegistration"/>
</beans:bean>
```

... more tags expanding clientRegistration

However this does not work. Does any one know how we can do this?

Body:
I want to use the XML configuration file for registering clients for OAuth2 in my web application. I know that there exist support for XML tags using the client-registrations tag.

However I want to register the client registration repository as a bean. So that it is extensible, something like this:

<beans:bean id="clientRegistrationRepository" class="org.springframework.security.oauth2.client.registration.ClientRegistrationRepository">
    <beans:constructor-arg index="0" ref="clientRegistration"/>
</beans:bean>

... more tags expanding clientRegistration

However this does not work. Does any one know how we can do this?


问:
I am struggling to write a transform python file for the tfx pipeline in transform component. I am working with object detection task
I am building a pipeline using tensorflow extended. The dataset is already conversted to the tfrecord for the ingestion. I want to do data preprocessing such as scalin, data augmentation along with bbox and prepare data for the object detection model training. As per I understand TFX, this things has to be done in transform component. I am struggling in this part. If someone can suggest me an example or give some kind of hint how to move ahead then it would be very helpful.

```<code>import os
import matplotlib.pyplot as plt

import tensorflow as tf
import tfx
from tfx.components.evaluator.component import Evaluator
from tfx.components.example_gen.import_example_gen.component import ImportExampleGen
from tfx.components.example_validator.component import ExampleValidator
from tfx.components.model_validator.component import ModelValidator
from tfx.components.pusher.component import Pusher
from tfx.components.schema_gen.component import SchemaGen
from tfx.components.statistics_gen.component import StatisticsGen
from tfx.components.trainer.component import Trainer
from tfx.components.transform.component import Transform
from tfx.orchestration.experimental.interactive.interactive_context import (
    InteractiveContext,
)
from tfx.proto import evaluator_pb2
from tfx.proto import example_gen_pb2
from tfx.proto import pusher_pb2
from tfx.proto import trainer_pb2
from tfx.v1 import proto

_dataset_tfrecord_path = ""
_pipeline_name = "od_pipeline"

output_conf = proto.Output(
    split_config=example_gen_pb2.SplitConfig(
        splits=[
            proto.SplitConfig.Split(name="train", hash_buckets=4),
            proto.SplitConfig.Split(name="eval", hash_buckets=1),
        ]
    )
)

example_gen = ImportExampleGen(input_base=_dataset_tfrecord_path, output_config=output_conf)

statistics_gen = StatisticsGen(examples=example_gen.outputs["examples"])

infer_schema = SchemaGen(statistics=statistics_gen.outputs["statistics"])

validate_stats = ExampleValidator(
    statistics=statistics_gen.outputs["statistics"], schema=infer_schema.outputs["schema"]
)

transform = Transform(
    examples=example_gen.outputs['examples'],
    schema=infer_schema.outputs['result'],
    module_file=TRANSFORM_MODULE
)

</code>```

I have tried to find the solution online but couldn't get anything useful.

Body:
I am building a pipeline using tensorflow extended. The dataset is already conversted to the tfrecord for the ingestion. I want to do data preprocessing such as scalin, data augmentation along with bbox and prepare data for the object detection model training. As per I understand TFX, this things has to be done in transform component. I am struggling in this part. If someone can suggest me an example or give some kind of hint how to move ahead then it would be very helpful.

import os
import matplotlib.pyplot as plt

import tensorflow as tf
import tfx
from tfx.components.evaluator.component import Evaluator
from tfx.components.example_gen.import_example_gen.component import ImportExampleGen
from tfx.components.example_validator.component import ExampleValidator
from tfx.components.model_validator.component import ModelValidator
from tfx.components.pusher.component import Pusher
from tfx.components.schema_gen.component import SchemaGen
from tfx.components.statistics_gen.component import StatisticsGen
from tfx.components.trainer.component import Trainer
from tfx.components.transform.component import Transform
from tfx.orchestration.experimental.interactive.interactive_context import (
    InteractiveContext,
)
from tfx.proto import evaluator_pb2
from tfx.proto import example_gen_pb2
from tfx.proto import pusher_pb2
from tfx.proto import trainer_pb2
from tfx.v1 import proto

_dataset_tfrecord_path = ""
_pipeline_name = "od_pipeline"

output_conf = proto.Output(
    split_config=example_gen_pb2.SplitConfig(
        splits=[
            proto.SplitConfig.Split(name="train", hash_buckets=4),
            proto.SplitConfig.Split(name="eval", hash_buckets=1),
        ]
    )
)

example_gen = ImportExampleGen(input_base=_dataset_tfrecord_path, output_config=output_conf)

statistics_gen = StatisticsGen(examples=example_gen.outputs["examples"])

infer_schema = SchemaGen(statistics=statistics_gen.outputs["statistics"])

validate_stats = ExampleValidator(
    statistics=statistics_gen.outputs["statistics"], schema=infer_schema.outputs["schema"]
)

transform = Transform(
    examples=example_gen.outputs['examples'],
    schema=infer_schema.outputs['result'],
    module_file=TRANSFORM_MODULE
)

I have tried to find the solution online but couldn't get anything useful.


问:
C++ locale with get_time_byname vs hardcoded
Which one is the best practice:

std::locale(std::cin.getloc(), new std::time_get_byname<char>("en_US"))

or std::locale("en_US.UTF8") ?

The context is when this used in e.g. sstream::imbue.


问:
can not maximize the window to full screen on tablet in pc mode
enter image description heresee this image, i can not press the maximize button on my application, but on Files Application, it can press, and change the window size, so what should i do? its android 11.0 and android 12.0 tablet

```<code><?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <application
        android:allowBackup="true"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.MyApplication"
        tools:targetApi="31">
        <uses-library
            android:name="com.sec.android.app.multiwindow"
            android:required="false"/>
        <meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />
        <activity
            android:name=".MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".SecActivity"
            android:exported="false"/>
    </application>

</manifest>
</code>```

which config i missed?

Body:
enter image description heresee this image, i can not press the maximize button on my application, but on Files Application, it can press, and change the window size, so what should i do? its android 11.0 and android 12.0 tablet

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <application
        android:allowBackup="true"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.MyApplication"
        tools:targetApi="31">
        <uses-library
            android:name="com.sec.android.app.multiwindow"
            android:required="false"/>
        <meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />
        <activity
            android:name=".MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".SecActivity"
            android:exported="false"/>
    </application>

</manifest>

which config i missed?


问:
How does initialization on demand holder idiom work with parameters?
Here is the link to initialization on demand holder idiom
I've created a class with Singleton design pattern and double locking strategy. I want to change this class to use initialization on demand holder, but I couldn't accross examples where this is parameterized.

How should I pass the parameters basePath1, basePath2 while using initialization on demand holder pattern ?

Would the present code and code with initialization on demand holder pattern cause any concurrency issues ?

```<code>
public class Api {
private String basePath1;
private String basePath2;

    private StringBuilder temporalEndpoint;
    private StringBuilder spatialEndpoint;
    private StringBuilder fileUploadEndpoint;
    private StringBuilder fileDownloadEndpoint;
    private StringBuilder fileDeleteEndpoint;
    private StringBuilder listMetaDataEndpoint;
    private static final Logger LOG = LogManager.getLogger(Api.class);

    private static volatile Api apiInstance;

    private Api(String basePath1, String basePath2) {
        this.basePath1 = basePath1;
        this.basePath2 = basePath2;
        buildEndpoints();
    }

    public static Api getInstance(String basePath1, String basePath2)
    {
        if(apiInstance == null)
        {
                synchronized(Api.class)
                  {
                         if(apiInstance == null)
                          {
                                  apiInstance = new Api(basePath1, basePath2);
                            }
                 }
             }
        return apiInstance;
    }

    public void buildEndpoints() {
        temporalEndpoint = new StringBuilder(basePath1).append(API_TEMPORAL);
        spatialEndpoint = new StringBuilder(basePath1).append(API_SPATIAL);
        fileUploadEndpoint = new StringBuilder(basePath1).append(API_FILE_UPLOAD);
        fileDownloadEndpoint = new StringBuilder(basePath1).append(API_FILE_DOWNLOAD);
        fileDeleteEndpoint = new StringBuilder(basePath2).append(API_FILE_DELETE);
        listMetaDataEndpoint = new StringBuilder(basePath2).append(API_LIST_METADATA);
    }
</code>```

Body:
Here is the link to initialization on demand holder idiom
I've created a class with Singleton design pattern and double locking strategy. I want to change this class to use initialization on demand holder, but I couldn't accross examples where this is parameterized.

How should I pass the parameters basePath1, basePath2 while using initialization on demand holder pattern ?

Would the present code and code with initialization on demand holder pattern cause any concurrency issues ?

public class Api {
private String basePath1;
private String basePath2;

    private StringBuilder temporalEndpoint;
    private StringBuilder spatialEndpoint;
    private StringBuilder fileUploadEndpoint;
    private StringBuilder fileDownloadEndpoint;
    private StringBuilder fileDeleteEndpoint;
    private StringBuilder listMetaDataEndpoint;
    private static final Logger LOG = LogManager.getLogger(Api.class);

    private static volatile Api apiInstance;

    private Api(String basePath1, String basePath2) {
        this.basePath1 = basePath1;
        this.basePath2 = basePath2;
        buildEndpoints();
    }

    public static Api getInstance(String basePath1, String basePath2)
    {
        if(apiInstance == null)
        {
                synchronized(Api.class)
                  {
                         if(apiInstance == null)
                          {
                                  apiInstance = new Api(basePath1, basePath2);
                            }
                 }
             }
        return apiInstance;
    }

    public void buildEndpoints() {
        temporalEndpoint = new StringBuilder(basePath1).append(API_TEMPORAL);
        spatialEndpoint = new StringBuilder(basePath1).append(API_SPATIAL);
        fileUploadEndpoint = new StringBuilder(basePath1).append(API_FILE_UPLOAD);
        fileDownloadEndpoint = new StringBuilder(basePath1).append(API_FILE_DOWNLOAD);
        fileDeleteEndpoint = new StringBuilder(basePath2).append(API_FILE_DELETE);
        listMetaDataEndpoint = new StringBuilder(basePath2).append(API_LIST_METADATA);
    }


问:
Tensorflow saved_model reading
I am looking for a method to read and further modify a tensorflow saved_model.

Current saved_model was transformed from a onnx model, containing a model.pb, a fingerprint.pb, an asset folder and a variables folder.

I am new to tensorflow and this might be a stupid question. Is there any method recommendation or guide? Thank you for helping.

I tried tf.saved_model.load() method, but the result it returns seems uneditable:object structure

Expecting to read and modify a tensorflow saved_model.

Title: Tensorflow saved_model reading


问:
Create a QML library
I want to create a CMake project that contains only a QML (dll/dylib or static) library (resources included).
My idea is to create a core QML library with all my stuff (custom components, style, theme, core icons, etc) and import it when needed in all my projects (like a .lib or a dll/dylib).
At the same time, I would not want to change the components resources path in the top level project.
I'm using Qt DesignStudio and Qt Creator for Qt 6.2.x.

Right now, I have created a folder into the import folder, adding this in the CMakeLists.txt

```<code>add_subdirectory(MyFrontEndCoreLib)
</code>```

Then, I have added a UICoreComponents and an Image folders into MyFrontEndCoreLib folder.
The CMakeLists.txt file into the UICoreComponents is the following:

```<code>qt_add_library(MyFrontEndCoreLib_UICoreComponents STATIC)
qt6_add_qml_module(MyFrontEndCoreLib_UICoreComponents
    URI "MyFrontEndCoreLib.UICoreComponents"
    VERSION 1.0
    QML_FILES
        IconLabel.qml
        BorderedRectangle.qml
        MyButton.qml

)

</code>```

But I have no clue how to include this code/files into a library.

Thank you in advance

Title: Create a QML library

Body:
I want to create a CMake project that contains only a QML (dll/dylib or static) library (resources included).
My idea is to create a core QML library with all my stuff (custom components, style, theme, core icons, etc) and import it when needed in all my projects (like a .lib or a dll/dylib).
At the same time, I would not want to change the components resources path in the top level project.
I'm using Qt DesignStudio and Qt Creator for Qt 6.2.x.

Right now, I have created a folder into the import folder, adding this in the CMakeLists.txt

add_subdirectory(MyFrontEndCoreLib)

Then, I have added a UICoreComponents and an Image folders into MyFrontEndCoreLib folder.
The CMakeLists.txt file into the UICoreComponents is the following:

qt_add_library(MyFrontEndCoreLib_UICoreComponents STATIC)
qt6_add_qml_module(MyFrontEndCoreLib_UICoreComponents
    URI "MyFrontEndCoreLib.UICoreComponents"
    VERSION 1.0
    QML_FILES
        IconLabel.qml
        BorderedRectangle.qml
        MyButton.qml

)

But I have no clue how to include this code/files into a library.

Thank you in advance


问:
How set the size of RStudio's Zoom pane?
I store my plots with ragg with defined sizes and resolution.

```<code>  ragg::agg_png("Test.png",
    res = 320, width = 11, height = 15, units = "in")
</code>```

If these plots are opened in the Plot Pane or in Zoom  the output is
totally different.

On the left is the ragg version and on the right is the Zoom version of
a plot.

I could find several posts which deal with the reverse problem of adjusting
the size of png to the size of the Zoom pane,

here
and here

but I could not find anything which describes, if it is possible to open Zoom

with the same parameter as the I save a png with ragg.

Changing the graphics devices in RStudio did not help. Opening a new
graphics device

```<code>dev.new(width = 11, height = 15, unit ='in', noRStudioGD = T, res = 300)
</code>```

did also not show any improvement.

Similar questions like RStudio Community
were closed without answer.

Therefore I am not sure, if it is possible at all, to define the Zoom pane
size and resolution so that it fits to the ragg-saved version.

If that is the case I would like to learn how experienced ggplot developers
develop there plots stepwise with individual size and res settings.

Body:
I store my plots with ragg with defined sizes and resolution.

  ragg::agg_png("Test.png",
    res = 320, width = 11, height = 15, units = "in")

If these plots are opened in the Plot Pane or in Zoom  the output is
totally different.

On the left is the ragg version and on the right is the Zoom version of
a plot.

I could find several posts which deal with the reverse problem of adjusting
the size of png to the size of the Zoom pane,

here
and here

but I could not find anything which describes, if it is possible to open Zoom

with the same parameter as the I save a png with ragg.

Changing the graphics devices in RStudio did not help. Opening a new
graphics device

dev.new(width = 11, height = 15, unit ='in', noRStudioGD = T, res = 300)

did also not show any improvement.

Similar questions like RStudio Community
were closed without answer.

Therefore I am not sure, if it is possible at all, to define the Zoom pane
size and resolution so that it fits to the ragg-saved version.

If that is the case I would like to learn how experienced ggplot developers
develop there plots stepwise with individual size and res settings.


问:
Fix the error "division by zero" in maple
I have three equations and three unknowns. When I run it in Maple, I get the error "division by zero". What should I do to fix this error?Do you know the reason for this, please?

This is the Maple code

```<code>restart;

r := 32*(6*m^2*xi + m^2 + 1)*(alpha*m^2 - 4*xi*sqrt(m^2/xi) + alpha)^2/(m^2*(alpha*m^2 - 16*xi*sqrt(m^2/xi) + alpha)^2*xi);

ns := -((m^2 + 1)*alpha*(alpha^2*(1/6 + xi)*m^6 + ((2*xi + 1/2)*alpha^2 - 3500*xi^2 - (1750*xi)/3)*m^4 + ((xi + 1/2)*alpha^2 - 8*xi^2 - (1762*xi)/3)*m^2 + alpha^2/6 - 4*xi)*sqrt(m^2/xi) - (2*alpha^2*(1/6 + xi)*m^8)/3 + (((2*xi)/3 + 1/3)*alpha^2 - 16*xi^2 - (8*xi)/3)*m^6 + (((10*xi)/3 + 5/3)*alpha^2 + (8*xi)/3)*m^4 + ((2*xi + 17/9)*alpha^2 + (16*xi)/3)*m^2 + (2*alpha^2)/3)/(2*sqrt(m^2/xi)*m^2*(6*m^2*xi + m^2 + 1)*xi*(alpha*m^2 - 4*xi*sqrt(m^2/xi) + alpha));

nt := -((alpha*m^2 - 4*xi*sqrt(m^2/xi) + alpha)*(alpha*(m^2 + 1)*sqrt(m^2/xi) - 4*m^2))/(12*sqrt(m^2/xi)*xi*m^2);

solve([0.9605 <= ns and ns <= 0.9693, 0 < r and r < 0.056, -0.76 < nt and nt < 0.52], {alpha, m, xi});
</code>```

I tried to use help maple and use the command it wrote. But either I don't know how to write the command or this command is not correct to use.
here is the link to some pictures of my work:command in help maple

error in program

Body:
I have three equations and three unknowns. When I run it in Maple, I get the error "division by zero". What should I do to fix this error?Do you know the reason for this, please?

This is the Maple code

restart;

r := 32*(6*m^2*xi + m^2 + 1)*(alpha*m^2 - 4*xi*sqrt(m^2/xi) + alpha)^2/(m^2*(alpha*m^2 - 16*xi*sqrt(m^2/xi) + alpha)^2*xi);

ns := -((m^2 + 1)*alpha*(alpha^2*(1/6 + xi)*m^6 + ((2*xi + 1/2)*alpha^2 - 3500*xi^2 - (1750*xi)/3)*m^4 + ((xi + 1/2)*alpha^2 - 8*xi^2 - (1762*xi)/3)*m^2 + alpha^2/6 - 4*xi)*sqrt(m^2/xi) - (2*alpha^2*(1/6 + xi)*m^8)/3 + (((2*xi)/3 + 1/3)*alpha^2 - 16*xi^2 - (8*xi)/3)*m^6 + (((10*xi)/3 + 5/3)*alpha^2 + (8*xi)/3)*m^4 + ((2*xi + 17/9)*alpha^2 + (16*xi)/3)*m^2 + (2*alpha^2)/3)/(2*sqrt(m^2/xi)*m^2*(6*m^2*xi + m^2 + 1)*xi*(alpha*m^2 - 4*xi*sqrt(m^2/xi) + alpha));

nt := -((alpha*m^2 - 4*xi*sqrt(m^2/xi) + alpha)*(alpha*(m^2 + 1)*sqrt(m^2/xi) - 4*m^2))/(12*sqrt(m^2/xi)*xi*m^2);

solve([0.9605 <= ns and ns <= 0.9693, 0 < r and r < 0.056, -0.76 < nt and nt < 0.52], {alpha, m, xi});

I tried to use help maple and use the command it wrote. But either I don't know how to write the command or this command is not correct to use.
here is the link to some pictures of my work:command in help maple

error in program


问:
Is there a way to filter with a logical condition covering multiple columns in pivot tables?
I need to filter rows of a pivot table that have no value in 2 columns. E.g. if rows are people and columns are fruits, I need to filter people who have no apples or pears (but may have other fruits).

I've tried to add a custom formula filter on the "filter" part of the pivot tables, but it is either not working or I'm not getting the syntax right. I'm not sure where I'm supposed to be pointing towards.

This is an example formula I would want to use in my pivot table filter:
=NOT(AND(ISBLANK(E4); (N4=0)))

I can have a workaround to this if I filter the actual columns of the sheet, as seen here, but that also filters the rest of the rows of the sheet, outside the pivot table which I do not want


问:
Redirect request to persist POST method? (cXML)
I have integration that uses cXML standard, where customer connects from his own system, to our system, to buy goods and then to be redirected back to his own system, with all those goods created in his system.

We already implemented this to work between Odoo and Ariba/SAP, but its not working properly with Dynamics 365. Problem happens on final step, when user needs to be redirected back to his system to end his purchase.

Every time it is redirected, it looks like it converts POST request to get and then gives this as a result:

From requests, it looks like it starts fine with a POST (and 308 redirect to persist that), but then it becomes GET.

So I am not sure if its Dynamics 365 doing that or maybe I am missing something to make it work properly? It also loooks like it triggers login to Dynamics (even though that user is already logged in).

I tried various ways to finish this step, but in all cases it ends up the same:

I tried simple submit with HTML/JS to see if maybe my implementation is doing something wrong:

<form id="cxml_form" method="POST" action="https://some-subdomain.dynamics.com/punchout/cxml/COOKIE" enctype="application/x-www-form-urlencoded">
  <input type="hidden" name="cXML-urlencoded" value='payloadPlaceholder'>
</form>

```
<p>Basically same thing.</p>
<p>Also tried to do it with <code>flask</code>:</p>
<pre class="lang-py prettyprint-override"><code>
@app.route('/cxml', methods=['POST'])
def send_cxml():
    return redirect(
        "https://some-subdomain.dynamics.com/punchout/cxml/COOKIE",
        308,
    )
</code>```

There is also this site to test CXML: https://punchoutcommerce.com/tools/cxml-order-tester

So using that, it receives response something like this:

```<code><!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
<!DOCTYPE html>
<html dir="ltr" class="" lang="en">
<head>
    <title>Sign in to your account</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="-1">
    <link rel="preconnect" href="https://aadcdn.msauth.net" crossorigin>
<meta http-equiv="x-dns-prefetch-control" content="on">
<link rel="dns-prefetch" href="//aadcdn.msauth.net">
<link rel="dns-prefetch" href="//aadcdn.msftauth.net">
...
...
</code>```

It looks like it just tries to redirect to login page (even though I am logged in to dynamics)?

Body:
I have integration that uses cXML standard, where customer connects from his own system, to our system, to buy goods and then to be redirected back to his own system, with all those goods created in his system.

We already implemented this to work between Odoo and Ariba/SAP, but its not working properly with Dynamics 365. Problem happens on final step, when user needs to be redirected back to his system to end his purchase.

Every time it is redirected, it looks like it converts POST request to get and then gives this as a result:

From requests, it looks like it starts fine with a POST (and 308 redirect to persist that), but then it becomes GET.

So I am not sure if its Dynamics 365 doing that or maybe I am missing something to make it work properly? It also loooks like it triggers login to Dynamics (even though that user is already logged in).

I tried various ways to finish this step, but in all cases it ends up the same:

I tried simple submit with HTML/JS to see if maybe my implementation is doing something wrong:

<form id="cxml_form" method="POST" action="https://some-subdomain.dynamics.com/punchout/cxml/COOKIE" enctype="application/x-www-form-urlencoded">
  <input type="hidden" name="cXML-urlencoded" value='payloadPlaceholder'>
</form>

Basically same thing.

Also tried to do it with flask:

@app.route('/cxml', methods=['POST'])
def send_cxml():
    return redirect(
        "https://some-subdomain.dynamics.com/punchout/cxml/COOKIE",
        308,
    )

There is also this site to test CXML: https://punchoutcommerce.com/tools/cxml-order-tester

So using that, it receives response something like this:

<!DOCTYPE html>

    <title>Sign in to your account</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="-1">
    <link rel="preconnect" href="https://aadcdn.msauth.net" crossorigin>
<meta http-equiv="x-dns-prefetch-control" content="on">
<link rel="dns-prefetch" href="//aadcdn.msauth.net">
<link rel="dns-prefetch" href="//aadcdn.msftauth.net">
...
...

It looks like it just tries to redirect to login page (even though I am logged in to dynamics)?


问:
How to authenticate internal corporate proxy using kerberos in order to reach external API
We have a requirement to invoke an external API which would require authentication of our internal corporate proxy through kerberos.

Earlier our proxy server accepted basic authentication so building proxy using my username and password worked. But now we are asked to use kerberos authentication

Earlier our proxy server accepted basic authentication so below code worked for me.

```<code>Proxy = {"http": f"http://user:password@proxy_server:proxy_port,
         "https": f"https://user:password@proxy_server:proxy_port"}
</code>```

How can we achieve this using kerberos authentication?

Body:
We have a requirement to invoke an external API which would require authentication of our internal corporate proxy through kerberos.

Earlier our proxy server accepted basic authentication so building proxy using my username and password worked. But now we are asked to use kerberos authentication

Earlier our proxy server accepted basic authentication so below code worked for me.

Proxy = {"http": f"http://user:password@proxy_server:proxy_port,
         "https": f"https://user:password@proxy_server:proxy_port"}

How can we achieve this using kerberos authentication?


问:
how can i get the data encryption algorithm sent from android app without decompile it
I want to make transactions directly through the API in the android application, the API has been found, the problem is when accessing the API must send encrypted data, how to find the algorithm for the encrypted data, the application I mean is

https://play.google.com/store/apps/details?id=com.digital.indosat.dealerapp

jadx-gui

As seen above in the AndroidManifest loading the source code at the path com.ooredoo.dealer.app.LoginOptions, but when I look at that path there are only 4 files, the source code for LoginOptions and the others is missing, and after I checked further this ProtectedOoredooApplication loads native code named libdexprotector.so

data sent from android

And this is encrypted data sent from the application

FYI, I have gotten some of the required encryption from a guy who has tried this app too, he told me he used 'tcp snipping' to see the encryption algorithm, is that possible?

I hope you can tell me how to use 'tcp snipping' correctly, thank you


问:
form on access, create a control that add a record from the previous form
```<code>
 The code is as follows but it does not work:
Private Sub Comando18_Click()
DoCmd.OpenForm "Msc_Assenza", acNormal, , , _
        acReadOnly, , "codice fiscale"
End Sub

Sub Form_Open(Cancel As Integer)
    Dim strEmployeeCF As String
     strEmployeeCF = Forms!Msc_Assenza.OpenArgs
     WhereCondition:= "Codice_fiscale" =  & txtCodice_fiscale.Value
    If Len(strEmployeeCF) > 0 Then
        DoCmd.GoToControl "Etichetta1"
        DoCmd.FindRecord strEmployeeCF, , True, , _
           True, , True
    End If
End Sub

</code>```

hello everyone
I need some help with VBA.
these are my first times programming and unfortunately i don't know my way around.
I have a mask and I want to create a command that from the initial mask adds another record, but returning a value present in the initial mask and the rest of the fields empty as the Add New Record command already does.

Body:
 The code is as follows but it does not work:
Private Sub Comando18_Click()
DoCmd.OpenForm "Msc_Assenza", acNormal, , , _
        acReadOnly, , "codice fiscale"
End Sub

Sub Form_Open(Cancel As Integer)
    Dim strEmployeeCF As String
     strEmployeeCF = Forms!Msc_Assenza.OpenArgs
     WhereCondition:= "Codice_fiscale" =  & txtCodice_fiscale.Value
    If Len(strEmployeeCF) > 0 Then
        DoCmd.GoToControl "Etichetta1"
        DoCmd.FindRecord strEmployeeCF, , True, , _
           True, , True
    End If
End Sub

hello everyone
I need some help with VBA.
these are my first times programming and unfortunately i don't know my way around.
I have a mask and I want to create a command that from the initial mask adds another record, but returning a value present in the initial mask and the rest of the fields empty as the Add New Record command already does.


问:
It is possible to run a chrome extension as a proxy server?
I am thinking of a browser extension that helps users to monitor website changes. This type of operation needs infrastructure for HTTP(S) requests.

I am wondering if can I build this network with all installed extensions. It's like crowd supported system. So every user will help the network by executing some requests(from others).

I found a related question, but I think the question is not clear enough:

Is it possible to use Google Chrome as a proxy server?


问:
GStreamer: dynamically link a tee while pipline is PLAYING
Using GStreamer 1.16.3 on Ubuntu 20, C/C++. At some point during runtime, I'm trying to link a tee element (its src_0 is already linked and playing) to a recording bin which ends with a filesink.

The following snippet: create the recording bin, get the new filesink element, set its location property, add the recording bin to pipeline, sync recording bin state with pipeline, get pipeline's tee element, get its src request pad, get recording bin's sink pad, link src and sink pads to complete the process.

```<code>auto error = (GError *)nullptr;
auto recording_bin = gst_parse_bin_from_description("queue ! filesink name=recording_filesink", true, &error);
auto filesink = gst_bin_get_by_name(GST_BIN(recording_bin), "recording_filesink");

g_object_set(G_OBJECT(filesink), "location", "/home/.../record.ts", NULL);
g_object_unref(filesink);
gst_bin_add(GST_BIN(pipeline), recording_bin);
gst_element_sync_state_with_parent(recording_bin);

auto tee = gst_bin_get_by_name(GST_BIN(pipeline), "tee");
auto tee_src = gst_element_get_request_pad(tee, "src_%u");
auto recording_sink = gst_element_get_static_pad(recording_bin, "sink");
auto ret = gst_pad_link(tee_src, recording_sink);

g_object_unref(recording_sink);
g_object_unref(tee_src);
g_object_unref(tee);
</code>```

After executing this above, ret is GST_PAD_LINK_OK, but the pipeline gets stuck - not displaying (1st tee src) and not recording (2nd tee src).

Is this the right way to dynamically link a tee src to a recording bin?

Body:
Using GStreamer 1.16.3 on Ubuntu 20, C/C++. At some point during runtime, I'm trying to link a tee element (its src_0 is already linked and playing) to a recording bin which ends with a filesink.

The following snippet: create the recording bin, get the new filesink element, set its location property, add the recording bin to pipeline, sync recording bin state with pipeline, get pipeline's tee element, get its src request pad, get recording bin's sink pad, link src and sink pads to complete the process.

auto error = (GError *)nullptr;
auto recording_bin = gst_parse_bin_from_description("queue ! filesink name=recording_filesink", true, &error);
auto filesink = gst_bin_get_by_name(GST_BIN(recording_bin), "recording_filesink");

g_object_set(G_OBJECT(filesink), "location", "/home/.../record.ts", NULL);
g_object_unref(filesink);
gst_bin_add(GST_BIN(pipeline), recording_bin);
gst_element_sync_state_with_parent(recording_bin);

auto tee = gst_bin_get_by_name(GST_BIN(pipeline), "tee");
auto tee_src = gst_element_get_request_pad(tee, "src_%u");
auto recording_sink = gst_element_get_static_pad(recording_bin, "sink");
auto ret = gst_pad_link(tee_src, recording_sink);

g_object_unref(recording_sink);
g_object_unref(tee_src);
g_object_unref(tee);

After executing this above, ret is GST_PAD_LINK_OK, but the pipeline gets stuck - not displaying (1st tee src) and not recording (2nd tee src).

Is this the right way to dynamically link a tee src to a recording bin?


问:
How to block script which is changing content of index page
I am working on a project it have one index file and 40+ 'JS' files if I change the content like in div, heading, paragraph, etc in index file due to some script it remains same as old and not showing the change when I open in live server so I am expecting that is there any way like if I change any tag in index page then if a script is trying to change the content of any particular tag then it will block it

Explained above


问:
Why is my data context class missing from the drop-down when i choose add controller in ASP.NET web application?
Why is my data context class missing from the drop-down when I choose add controller in an ASP.NET web application (running on the .NET Framework)?</p>


问:
current CPU usage percentage Linux in C#
I'm trying to report a total CPU usage in a Linux system. It reports every 10 seconds. I have multiple processes running on several dockers so running Process.GetProcesses() got me an error of unable to retrieve the specified information about the process. it may have exited or may be privileged. My computer has 12 CPUs and 2 for every thread:         meaning it is using 6 cores. I need an efficient way to calculate current CPU usage of all the computer at given time.
My attempts have been:

TimeSpan delta = DateTime.Now - _lastTimeBuildReport;

double cpuLoad = 100* (currentExporterDic["node_cpu_seconds_total"].GetSum("idle") - _previousExporterDic["node_cpu_seconds_total"].GetSum("idle")) / delta.TotalSeconds;

Which gave me strange values (3 times what is real)
And this which gave the error, after ASP.NET CORE LINUX Get CPU USAGE

```<code>private double CalculateToTotalCPUUsage(double totalMsPassed)
{
  try
     {
       double totalCpuUsagePercentage = 0;
       string getProccesorsCoresCMD = "grep 'cpu cores' /proc/cpuinfo | uniq | grep -Eo '[0-9]{1,4}'";
       string[] coresLines = DotNetUtilities.DotNetUtilities.GetOsCmdLineOutput(getProccesorsCoresCMD).Lines;
       int cpuCores = int.Parse(coresLines[0]);
       Process[] allProc = Process.GetProcesses();
       foreach (Process process in allProc)
       {
         // Start watching CPU
         var currentProStartCpuUsage = process.TotalProcessorTime;

         //Delay the function so we can measure the same CPU load

        Task.Delay(Convert.ToInt32(totalMsPassed)).Wait();
        var currentProEndCpuUsage = process.TotalProcessorTime;
        var currentProCpuUsedMs = (currentProEndCpuUsage - currentProStartCpuUsage).TotalMilliseconds;
        var currentProCpuUsageTotal = currentProCpuUsedMs / (cpuCores * totalMsPassed);
        var currentProCpuUsagePercentage = currentProCpuUsageTotal * 100;
        totalCpuUsagePercentage += currentProCpuUsagePercentage;
       }

     return totalCpuUsagePercentage;
     }
    catch (Exception ex)
     {
       Logger.LogError($"Couldn't calculate total CPU usage. Reason: {ex.Message} {ex.StackTrace}");
        return -1;
   }
}
</code>```

Body:
I'm trying to report a total CPU usage in a Linux system. It reports every 10 seconds. I have multiple processes running on several dockers so running Process.GetProcesses() got me an error of unable to retrieve the specified information about the process. it may have exited or may be privileged. My computer has 12 CPUs and 2 for every thread:         meaning it is using 6 cores. I need an efficient way to calculate current CPU usage of all the computer at given time.
My attempts have been:

TimeSpan delta = DateTime.Now - _lastTimeBuildReport;

double cpuLoad = 100* (currentExporterDic["node_cpu_seconds_total"].GetSum("idle") - _previousExporterDic["node_cpu_seconds_total"].GetSum("idle")) / delta.TotalSeconds;

Which gave me strange values (3 times what is real)
And this which gave the error, after ASP.NET CORE LINUX Get CPU USAGE

private double CalculateToTotalCPUUsage(double totalMsPassed)
{
  try
     {
       double totalCpuUsagePercentage = 0;
       string getProccesorsCoresCMD = "grep 'cpu cores' /proc/cpuinfo | uniq | grep -Eo '[0-9]{1,4}'";
       string[] coresLines = DotNetUtilities.DotNetUtilities.GetOsCmdLineOutput(getProccesorsCoresCMD).Lines;
       int cpuCores = int.Parse(coresLines[0]);
       Process[] allProc = Process.GetProcesses();
       foreach (Process process in allProc)
       {
         // Start watching CPU
         var currentProStartCpuUsage = process.TotalProcessorTime;

         //Delay the function so we can measure the same CPU load

        Task.Delay(Convert.ToInt32(totalMsPassed)).Wait();
        var currentProEndCpuUsage = process.TotalProcessorTime;
        var currentProCpuUsedMs = (currentProEndCpuUsage - currentProStartCpuUsage).TotalMilliseconds;
        var currentProCpuUsageTotal = currentProCpuUsedMs / (cpuCores * totalMsPassed);
        var currentProCpuUsagePercentage = currentProCpuUsageTotal * 100;
        totalCpuUsagePercentage += currentProCpuUsagePercentage;
       }

     return totalCpuUsagePercentage;
     }
    catch (Exception ex)
     {
       Logger.LogError($"Couldn't calculate total CPU usage. Reason: {ex.Message} {ex.StackTrace}");
        return -1;
   }
}


问:
Android - Ionic - Bluetooth pairing
I am developing 2 applications : one Android specific and one with ionic (Android + iPhone).

I wish to use Bluetooth between my 2 applications and I can't display the popup with the code to confirm the association between both devices because the Android apps run on a device without screen.

My both applications communicate via the Internet, I think I can use this to share the code ?

My idea :

The Android app without screen is the bluetooth server

This app generate a code and send the code to the Ionic App by Internet

The Ionic app use this code to open the Bluetooth connection

Is there a way to do this ?

Thank you and have a nice year

Title: Android - Ionic - Bluetooth pairing


问:
Apache logging twice to /proc/1/fd/1
I am trying to use tee to log into two locations:

file in persistent storage

Docker stdout

Error log line from VirtualHost config:

```<code>ErrorLog "|/usr/bin/tee -a /var/log/apache/error.log /proc/1/fd/1"
</code>```

Now the problem is that errors are logged twice in /proc/1/fd/1 (as docker logs states), yet error is only logged once into /var/log/apache/error.log

I´ve also tried run from cli:

```<code>echo 123 | /usr/bin/tee -a /tmp/test /proc/1/fd/1
</code>```

This succesfully writes only once to both file and stdout.

Is there some reason why Apache logs writes twice to /proc/1/fd/1 while it logs only once to file and /usr/bin/tee also works as expected?

Title: Apache logging twice to /proc/1/fd/1

Body:
I am trying to use tee to log into two locations:

file in persistent storage

Docker stdout

Error log line from VirtualHost config:

ErrorLog "|/usr/bin/tee -a /var/log/apache/error.log /proc/1/fd/1"

Now the problem is that errors are logged twice in /proc/1/fd/1 (as docker logs states), yet error is only logged once into /var/log/apache/error.log

I´ve also tried run from cli:

echo 123 | /usr/bin/tee -a /tmp/test /proc/1/fd/1

This succesfully writes only once to both file and stdout.

Is there some reason why Apache logs writes twice to /proc/1/fd/1 while it logs only once to file and /usr/bin/tee also works as expected?


问:
Wait for new url from server before opening it - React
I'm trying to fetch download links from the server on demand, I need react to wait until the new url is set before downloading it. I do have a hook that sets a loading value that I can check but it doesn't seem to work properly as it seems like its not waiting for the new url. It is currently using the already set urls on every object (after a few second it changes to the new/correct one when the response comes back)

This is what I currently have

Hook for the url:

export const useFetchFileUrl = (filePath: string) => {
    const [fileUrl, setFileUrl] = useState("#");
    const [loading, setLoading] = useState(false);

    const fetchFileUrl = async (filePath: string) => {
        const res = await fetch(server)
        return res.data;
    };

    useEffect(() => {
        const retrieveFileUrl = async () => {
            setLoading(true);
            const { fileUrl } = await fetchFileUrl(filePath);
            setFileUrl(fileUrl); // correct url is coming back
            setLoading(false);
        };
        if (filePath && filePath !== "") retrieveFileUrl();
    }, [filePath]);

    return { loading, fileUrl };
};
```
<p>And in the component I'm trying to wait for the url like this</p>
<pre class="lang-js prettyprint-override"><code>const FileSystem = ({ fileTree, handleUploadSelected }: FilePickerProps) => {
    const [filePath, setFilePath] = useState<string>("");
    const { fileUrl, loading } = useFetchFileUrl(filePath);

    const handleDownloadClick = useCallback(
        (filePath: string) => {
            setFilePath(filePath); // This triggers a new url fetch
            while (loading) {
                document.body.style.cursor = "wait";
            }
            if (!loading && fileUrl !== "#") {
                document.body.style.cursor = "default";
                window.open(fileUrl);
            }
        },
        [setFilePath, loading, fileUrl],
    );
</code>```

And this is how the button looks like

result.push(

Body:
I'm trying to fetch download links from the server on demand, I need react to wait until the new url is set before downloading it. I do have a hook that sets a loading value that I can check but it doesn't seem to work properly as it seems like its not waiting for the new url. It is currently using the already set urls on every object (after a few second it changes to the new/correct one when the response comes back)

This is what I currently have

Hook for the url:

export const useFetchFileUrl = (filePath: string) => {
    const [fileUrl, setFileUrl] = useState("#");
    const [loading, setLoading] = useState(false);

    const fetchFileUrl = async (filePath: string) => {
        const res = await fetch(server)
        return res.data;
    };

    useEffect(() => {
        const retrieveFileUrl = async () => {
            setLoading(true);
            const { fileUrl } = await fetchFileUrl(filePath);
            setFileUrl(fileUrl); // correct url is coming back
            setLoading(false);
        };
        if (filePath && filePath !== "") retrieveFileUrl();
    }, [filePath]);

    return { loading, fileUrl };
};

And in the component I'm trying to wait for the url like this

const FileSystem = ({ fileTree, handleUploadSelected }: FilePickerProps) => {
    const [filePath, setFilePath] = useState<string>("");
    const { fileUrl, loading } = useFetchFileUrl(filePath);

    const handleDownloadClick = useCallback(
        (filePath: string) => {
            setFilePath(filePath); // This triggers a new url fetch
            while (loading) {
                document.body.style.cursor = "wait";
            }
            if (!loading && fileUrl !== "#") {
                document.body.style.cursor = "default";
                window.open(fileUrl);
            }
        },
        [setFilePath, loading, fileUrl],
    );

And this is how the button looks like

result.push(


问:
Airflow scheduler container does not start after config update
I have exec into scheduler container and change /opt/bitnami/airflow/airflow.cfg on the API line to

[api]
auth_backend=airflow.api.auth.backend.basic_auth

When i try to restart the container, it exited.

I use docker start -i airflow-scheduler, the below returns

```<code>Welcome to the Bitnami airflow-scheduler container
Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-airflow-scheduler
Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-airflow-scheduler/issues

INFO  ==> Starting airflow-scheduler...
Waiting for db...
Database is ready
INFO  ==> Starting airflow...
[2023-01-03 08:26:02,692] {__init__.py:71} CRITICAL - Cannot import Traceback (most recent call last):
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/airflow/api/__init__.py", line 55, in load_auth
airflow.api.auth.backend.basic_auth for API authentication due to: No module named 'airflow.api.auth.backend.basic_auth'
    api_auth = import_module(auth_backend)
  File "/opt/bitnami/python/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'airflow.api.auth.backend.basic_auth'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/bitnami/airflow/venv/bin/airflow", line 26, in <module>
    from airflow.bin.cli import CLIFactory
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/airflow/bin/cli.py", line 93, in <module>
    api.load_auth()
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/airflow/api/__init__.py", line 73, in load_auth
    raise AirflowException(err)
airflow.exceptions.AirflowException: No module named 'airflow.api.auth.backend.basic_auth'

</code>```

and the container exits. Could someone help me on how to change back the auth.backend to deny_all

Thanks

All are stated as above

Body:
I have exec into scheduler container and change /opt/bitnami/airflow/airflow.cfg on the API line to

[api]
auth_backend=airflow.api.auth.backend.basic_auth

When i try to restart the container, it exited.

I use docker start -i airflow-scheduler, the below returns

Welcome to the Bitnami airflow-scheduler container
Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-airflow-scheduler
Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-airflow-scheduler/issues

INFO  ==> Starting airflow-scheduler...
Waiting for db...
Database is ready
INFO  ==> Starting airflow...
[2023-01-03 08:26:02,692] {__init__.py:71} CRITICAL - Cannot import Traceback (most recent call last):
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/airflow/api/__init__.py", line 55, in load_auth
airflow.api.auth.backend.basic_auth for API authentication due to: No module named 'airflow.api.auth.backend.basic_auth'
    api_auth = import_module(auth_backend)
  File "/opt/bitnami/python/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'airflow.api.auth.backend.basic_auth'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/bitnami/airflow/venv/bin/airflow", line 26, in <module>
    from airflow.bin.cli import CLIFactory
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/airflow/bin/cli.py", line 93, in <module>
    api.load_auth()
  File "/opt/bitnami/airflow/venv/lib/python3.6/site-packages/airflow/api/__init__.py", line 73, in load_auth
    raise AirflowException(err)
airflow.exceptions.AirflowException: No module named 'airflow.api.auth.backend.basic_auth'

and the container exits. Could someone help me on how to change back the auth.backend to deny_all

Thanks

All are stated as above


问:
How do I grayscale images programmatically?
Most of the libraries out there are about filtering image components. All I really want is a library or something which makes it possible to grayscale images programmatically. It might work like, when you provide it with an image path, the library would asynchronously spit out the path of the grayscaled image.</p>