问:
setup.py module getting error when executing the code
When i am executing this code
`

```<code>from setuptools import setup, find_packages
from pathlib import Path

this_directory = Path(__file__).parent
long_description = (this_directory / "C:/Users/DELL/Downloads/cashflower-main/README.md").read_text()

setup(
    author="Zuzanna Chmielewska",
    description="Framework for actuarial cash flow models",
    include_package_data=True,
    long_description=long_description,
    long_description_content_type="text/markdown",
    name="tutorials",
    packages=find_packages(include=["tutorials", "tutorials.*"]),
)
</code>```

i am getting the error ......
Exception has occurred: SystemExit
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

```<code>error: no commands supplied
distutils.errors.DistutilsArgError: no commands supplied

During handling of the above exception, another exception occurred:

  File "C:\Users\DELL\Downloads\cashflower-main\tutorials\setup.py", line 8, in <module>
    setup(
SystemExit: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: no commands supplied
</code>```

how can i resolve the error in setup.py

Body:
When i am executing this code
`

from setuptools import setup, find_packages
from pathlib import Path

this_directory = Path(__file__).parent
long_description = (this_directory / "C:/Users/DELL/Downloads/cashflower-main/README.md").read_text()

setup(
    author="Zuzanna Chmielewska",
    description="Framework for actuarial cash flow models",
    include_package_data=True,
    long_description=long_description,
    long_description_content_type="text/markdown",
    name="tutorials",
    packages=find_packages(include=["tutorials", "tutorials.*"]),
)

i am getting the error ......
Exception has occurred: SystemExit
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: no commands supplied
distutils.errors.DistutilsArgError: no commands supplied

During handling of the above exception, another exception occurred:

  File "C:\Users\DELL\Downloads\cashflower-main\tutorials\setup.py", line 8, in <module>
    setup(
SystemExit: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: no commands supplied

how can i resolve the error in setup.py


来源: stackexchange

问:
Importing modules from top-level to lower-level files (for the thousandth time)
IMAGE-Generalized File Tree

Okay everyone, I have tried all the answers on here. Above is the generalized version of my file structure. In my file Aa_func.py I want to import everything in project_imports.py.
In other words I would like to run

```<code>from top.imports.project_imports import *
</code>```

Here is everything I have tried:

Put an __init__.py file in top and then try from top.imports.project_imports import *

Tried using relative importing from ..imports.project_imports import *

I tried putting an import statement in __init__.py for the A directory. Then importing using relative import again in Aa. I saw this done in a 3rd party package I routinely work with.

I either get the error about no parent package detected or no module found.

Any help would be appreciated. I feel like this should be so simple yet here I am. I would think that the import path would always start from top and search from there but I guess not.

ContentLicense: CC BY-SA 4.0

Body:
IMAGE-Generalized File Tree

Okay everyone, I have tried all the answers on here. Above is the generalized version of my file structure. In my file Aa_func.py I want to import everything in project_imports.py.
In other words I would like to run

from top.imports.project_imports import *

Here is everything I have tried:

Put an __init__.py file in top and then try from top.imports.project_imports import *

Tried using relative importing from ..imports.project_imports import *

I tried putting an import statement in __init__.py for the A directory. Then importing using relative import again in Aa. I saw this done in a 3rd party package I routinely work with.

I either get the error about no parent package detected or no module found.

Any help would be appreciated. I feel like this should be so simple yet here I am. I would think that the import path would always start from top and search from there but I guess not.


问:
recharts synchronize x-axis for two datasets
I'm trying to set up my graph so that it will display barcharts (dataset 1) and linecharts (dataset 2) simultaneously.
However, when I set this up, the x-axis doesn't really sync up together. Is there a way to get the x-axis to sync up for the two datasets? For example, 350 from dataset2 matches on top of 350 from dataset1? The length of dataset2 is about ~200 and the length of dataset1 is about ~2000.
Here is the graph from recharts:

Here is my code:

```<code>  const barChart = chartData[0] ? (
    <ResponsiveContainer width="100%" aspect={2}>
      <ComposedChart data={chartData} barGap={0}>
        <XAxis dataKey="strike_price" xAxisId={0} />
        <XAxis dataKey="strike_price" xAxisId={1} hide />
        <XAxis dataKey="strike_price" xAxisId={2} hide />
        <XAxis dataKey="strike_price" xAxisId={3} axisLine={false} />
        <YAxis tickFormatter={formatNumbers} yAxisId={0} />
        <YAxis tickFormatter={formatNumbers} yAxisId={1} orientation="right" />
        <Tooltip />
        <Legend />
        <Bar
          data={chartData}
          dataKey="c_notion_expo"
          fill="green"
          xAxisId={0}
          barSize={100}
          fillOpacity={0.9}
        />
        <Bar
          data={chartData}
          dataKey="p_notion_expo"
          fill="red"
          xAxisId={1}
          barSize={100}
          fillOpacity={0.9}
        />
        <Bar
          data={chartData}
          dataKey="total_notional_exposure"
          fill="black"
          barSize={50}
          xAxisId={2}
          fillOpacity={0.9}
        />
        <Line
          data={theoData}
          type="monotone"
          dataKey="total_gamma"
          xAxisId={3}
          yAxisId={1}
        />
      </ComposedChart>
    </ResponsiveContainer>
  ) : null;
</code>```

Body:
I'm trying to set up my graph so that it will display barcharts (dataset 1) and linecharts (dataset 2) simultaneously.
However, when I set this up, the x-axis doesn't really sync up together. Is there a way to get the x-axis to sync up for the two datasets? For example, 350 from dataset2 matches on top of 350 from dataset1? The length of dataset2 is about ~200 and the length of dataset1 is about ~2000.
Here is the graph from recharts:

Here is my code:

  const barChart = chartData[0] ? (
    <ResponsiveContainer width="100%" aspect={2}>
      <ComposedChart data={chartData} barGap={0}>
        <XAxis dataKey="strike_price" xAxisId={0} />
        <XAxis dataKey="strike_price" xAxisId={1} hide />
        <XAxis dataKey="strike_price" xAxisId={2} hide />
        <XAxis dataKey="strike_price" xAxisId={3} axisLine={false} />
        <YAxis tickFormatter={formatNumbers} yAxisId={0} />
        <YAxis tickFormatter={formatNumbers} yAxisId={1} orientation="right" />
        <Tooltip />
        <Legend />
        <Bar
          data={chartData}
          dataKey="c_notion_expo"
          fill="green"
          xAxisId={0}
          barSize={100}
          fillOpacity={0.9}
        />
        <Bar
          data={chartData}
          dataKey="p_notion_expo"
          fill="red"
          xAxisId={1}
          barSize={100}
          fillOpacity={0.9}
        />
        <Bar
          data={chartData}
          dataKey="total_notional_exposure"
          fill="black"
          barSize={50}
          xAxisId={2}
          fillOpacity={0.9}
        />
        <Line
          data={theoData}
          type="monotone"
          dataKey="total_gamma"
          xAxisId={3}
          yAxisId={1}
        />
      </ComposedChart>
    </ResponsiveContainer>
  ) : null;


问:
React Native zoom sdk ios error " Undefined symbol: _OBJC_CLASS_$_ZoomVideoSDK"
In my project add package for video call

```<code>@zoom/react-native-videosdk
</code>```

I have followed their documentation and installed SDK for ios. but when running the build from Xcode gets the following error.
enter image description here

Errors:

Undefined symbol: OBJC_CLASS$_ZoomVideoSDKSessionContext

Undefined symbol: OBJC_CLASS$_ZoomVideoSDKVideoOptions

Undefined symbol: OBJC_CLASS$_ZoomVideoSDKAudioOptions

Undefined symbol: OBJC_CLASS$_ZoomVideoSDK

Undefined symbol: OBJC_CLASS$_ZoomVideoSDKInitParams

Add framework in Link binary with libraries

Add in embed frameworks

in build setting setup Other Linker Flags with -all_load

pod delete reinstall, rebuild

Body:
In my project add package for video call

@zoom/react-native-videosdk

I have followed their documentation and installed SDK for ios. but when running the build from Xcode gets the following error.
enter image description here

Errors:

Undefined symbol: OBJC_CLASS$_ZoomVideoSDKSessionContext

Undefined symbol: OBJC_CLASS$_ZoomVideoSDKVideoOptions

Undefined symbol: OBJC_CLASS$_ZoomVideoSDKAudioOptions

Undefined symbol: OBJC_CLASS$_ZoomVideoSDK

Undefined symbol: OBJC_CLASS$_ZoomVideoSDKInitParams

Add framework in Link binary with libraries

Add in embed frameworks

in build setting setup Other Linker Flags with -all_load

pod delete reinstall, rebuild


问:
error getting access token for service account (connection time out) error
I want to solve for that error.

[error log]

error getting access token for service account (connection time out)

I add hosts AND firewall add ip but connetiocn time out or operation time out throw an error

```<code>netstat -ano
TCP    x.x.x.x:18795  142.250.206.205      ESTABLISHED
</code>```

Communication works, but it seems to be blocked by other hosts.

```<code>URL url = new URL("https://accounts.google.com/o/oauth2/auth");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
※ connection time out
</code>```

I want to know the answer

[ADD LIST]

```<code>port (80,443)

142.250.206.205 accounts.google.com

172.217.25.173 accounts.google.com

142.250.76.141 accounts.google.com

142.250.206.237 accounts.google.com

172.217.161.234 oauth2.googleapis.com

142.250.207.106 oauth2.googleapis.com

142.250.76.138 oauth2.googleapis.com

142.250.206.202 oauth2.googleapis.com

142.250.206.234 oauth2.googleapis.com

172.217.161.202 oauth2.googleapis.com

172.217.25.170 oauth2.googleapis.com

216.239.38.57 fcm.googleapis.com

216.239.36.57 fcm.googleapis.com

216.239.36.55 fcm.googleapis.com

216.239.38.55 fcm.googleapis.com
</code>```

Body:
I want to solve for that error.

[error log]

error getting access token for service account (connection time out)

I add hosts AND firewall add ip but connetiocn time out or operation time out throw an error

netstat -ano
TCP    x.x.x.x:18795  142.250.206.205      ESTABLISHED

Communication works, but it seems to be blocked by other hosts.

URL url = new URL("https://accounts.google.com/o/oauth2/auth");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
※ connection time out

I want to know the answer

[ADD LIST]

port (80,443)

142.250.206.205 accounts.google.com

172.217.25.173 accounts.google.com

142.250.76.141 accounts.google.com

142.250.206.237 accounts.google.com

172.217.161.234 oauth2.googleapis.com

142.250.207.106 oauth2.googleapis.com

142.250.76.138 oauth2.googleapis.com

142.250.206.202 oauth2.googleapis.com

142.250.206.234 oauth2.googleapis.com

172.217.161.202 oauth2.googleapis.com

172.217.25.170 oauth2.googleapis.com

216.239.38.57 fcm.googleapis.com

216.239.36.57 fcm.googleapis.com

216.239.36.55 fcm.googleapis.com

216.239.38.55 fcm.googleapis.com


问:
jBPM Workflow initiate performance issue while setting customSLADueDate
I am facing performance bottleneck while initiating a Process if I set customSLADueDate in jBPM workflow like below in the workflow

```<code>    <bpmn2:extensionElements>
      <tns:metaData name="customSLADueDate">
        <tns:metaValue><![CDATA[4d]]></tns:metaValue>
      </tns:metaData>
    <bpmn2:extensionElements>

</code>```

But, if I remove the above snippet from the workflow xml then I do not face any performance issue. I am using PER_REQUEST Runtime strategy to deploy the container container containing the said process.
Can anyone please help identifying what should be done in order to resolve the performance issue while setting the customeSLADueDate?

Note: I am trying to initiate the workflow through jMeter where I am running 25 Threads with 25s as ramp up time. It gives me approx. 5 seconds of 95%ile with customSLADueDate and approx 500m without setting customSLADueDate.

Thanks in advance for your help.

Body:
I am facing performance bottleneck while initiating a Process if I set customSLADueDate in jBPM workflow like below in the workflow

    <bpmn2:extensionElements>
      <tns:metaData name="customSLADueDate">
        <tns:metaValue><![CDATA[4d]]></tns:metaValue>
      </tns:metaData>
    <bpmn2:extensionElements>

But, if I remove the above snippet from the workflow xml then I do not face any performance issue. I am using PER_REQUEST Runtime strategy to deploy the container container containing the said process.
Can anyone please help identifying what should be done in order to resolve the performance issue while setting the customeSLADueDate?

Note: I am trying to initiate the workflow through jMeter where I am running 25 Threads with 25s as ramp up time. It gives me approx. 5 seconds of 95%ile with customSLADueDate and approx 500m without setting customSLADueDate.

Thanks in advance for your help.


问:
Is there a way to remove the certain things on a forest plot in R?
I am a complete Newby to R and just ran a meta analyses using Metafor and Meta.

I have generated a forest plot but I would like to remove the column TE and seTE on the left side of the plot. Bonus points if you also know how to remove the 3 studies that have no data in the middle.(https://i.stack.imgur.com/uvjG3.png)

forest.meta(m.gen,
print.tau2 = FALSE,
leftlabs = c("Author"))

Thank you!

I have tried to google different things to put in but nothing I have tried has worked so far. Please help haha.


问:
Issue with next/image in NextJS V12.3.0 specifically with alt attribute
I use next/image to render images on the site and set the alt tag appropriately. The images I use originate from a CDN. I have a NextJS-based repository. The issue is that, despite the fact that the image is rendering correctly, whenever I check my site's Google cache and switch to the text-only version, Google attempts to replace the image with the text specified in the alt attribute, which is somehow repeating itself. As a result, instead of displaying "Some Image ALT," Google displays "Some Image ALTSome Image ALT."

Here's my implementation for reference:

```<code><div className="videoCard__image">
  <Image
    src={bannerUrl}
    alt={titleLabel}
    layout="responsive"
    width={123.6}
    height={120}
    className="videoCard__image--banner"
    priority={loadPriority}
    sizes="33vw"
    quality={80}
  />
  <PlayCircleOutline className="videoCard__image--play-icon" />
</div>
</code>```

Rendered image HTML from next/image ->
Rendered image HTML from next/image

Google cache text only version ->
Google cache text only version

Expectation: ALT attributte text to occur to once instead of twice.

Body:
I use next/image to render images on the site and set the alt tag appropriately. The images I use originate from a CDN. I have a NextJS-based repository. The issue is that, despite the fact that the image is rendering correctly, whenever I check my site's Google cache and switch to the text-only version, Google attempts to replace the image with the text specified in the alt attribute, which is somehow repeating itself. As a result, instead of displaying "Some Image ALT," Google displays "Some Image ALTSome Image ALT."

Here's my implementation for reference:

  <Image
    src={bannerUrl}
    alt={titleLabel}
    layout="responsive"
    width={123.6}
    height={120}
    className="videoCard__image--banner"
    priority={loadPriority}
    sizes="33vw"
    quality={80}
  />
  <PlayCircleOutline className="videoCard__image--play-icon" />

Rendered image HTML from next/image ->
Rendered image HTML from next/image

Google cache text only version ->
Google cache text only version

Expectation: ALT attributte text to occur to once instead of twice.


问:
QNetworkAccessManager send PUT request with JSON
I want to send a put request with JSON body, but with QNetworkAccessManager doesn't have the option to send a request with JSON so I converted it to QByteArray, the structure of the body, when converted to QByteArray, is not a JSON format so that I received an Error with

"Error downloading https://example.api.com/something/DataSet('123456780XYZ') - server replied: Forbidden"

The JSON format I want is like this:

```<code>{
    "d": {
        "Duration": "0.000",
        "Id": "123456780XYZ",
        "LoadCumulLimit": "0.000",
        "Notes": "send from postman in Json format"
    }
}
</code>```

Here is what did I do

```<code>    QJsonObject data;
    data["Duration"] = workplace->data["duration"];
    data["Id"] = id;
    data["LoadCumulLimit"] = workplace->data["load_cumul_limit"];
    data["Notes"] = workplace->dataText["Notes"];

    QJsonObject newData;
    newData["d"] = data;
    QJsonDocument doc(newData);

    qDebug() << url;
    QByteArray finalData = doc.toJson();
    qDebug() << finalData;

    reply = manager->put(request, finalData);
    connect(reply, &QNetworkReply::finished, [=](){
        if(reply->error() == QNetworkReply::NoError){
                QString contents = QString::fromUtf8(reply->readAll());
                qDebug() << contents;
            }
            else{
                QString err = reply->errorString();
                qDebug() << err;
            }
            reply->deleteLater();
    });
</code>```

But I received the QByteArray like this:
"{\n    \"d\": {\n        \"Duration\": 8,\n        \"IgelId\": \"123456780XYZ\",\n        \"LoadCumulLimit\": 25,\n        \"Notes\": \"send from IGEL\"\n    }\n}\n"

Body:
I want to send a put request with JSON body, but with QNetworkAccessManager doesn't have the option to send a request with JSON so I converted it to QByteArray, the structure of the body, when converted to QByteArray, is not a JSON format so that I received an Error with

"Error downloading https://example.api.com/something/DataSet('123456780XYZ') - server replied: Forbidden"

The JSON format I want is like this:

{
    "d": {
        "Duration": "0.000",
        "Id": "123456780XYZ",
        "LoadCumulLimit": "0.000",
        "Notes": "send from postman in Json format"
    }
}

Here is what did I do

    QJsonObject data;
    data["Duration"] = workplace->data["duration"];
    data["Id"] = id;
    data["LoadCumulLimit"] = workplace->data["load_cumul_limit"];
    data["Notes"] = workplace->dataText["Notes"];

    QJsonObject newData;
    newData["d"] = data;
    QJsonDocument doc(newData);

    qDebug() << url;
    QByteArray finalData = doc.toJson();
    qDebug() << finalData;

    reply = manager->put(request, finalData);
    connect(reply, &QNetworkReply::finished, [=](){
        if(reply->error() == QNetworkReply::NoError){
                QString contents = QString::fromUtf8(reply->readAll());
                qDebug() << contents;
            }
            else{
                QString err = reply->errorString();
                qDebug() << err;
            }
            reply->deleteLater();
    });

But I received the QByteArray like this:
"{\n    \"d\": {\n        \"Duration\": 8,\n        \"IgelId\": \"123456780XYZ\",\n        \"LoadCumulLimit\": 25,\n        \"Notes\": \"send from IGEL\"\n    }\n}\n"


问:
Filtering Dates based on DateRangeSelector user input using datepicker
I have the following lines of code that you can display quickly using https://codesandbox.io/s/react-new. Make sure to select the dependency "react-datepicker" from the down left corner:

What I have:

1 check box, and 2 date input boxes for users to select a specific date range.

What I want:

I have an array of dates ("my_date_array"), and I want a code to filter the dates based on the following conditions:

If the checkbox is selected, display all data.
If the checkbox is not selected, display only the data that is within the (inclusive) range of the user-selected start and end date.

The format does not matter I want to display filtered my_date_array based on the conditions on the screen below the input boxes.

One important note is that I want to be able to take the filtered date array outside the function and still be able to use it.

Here is what I have, Thank you for your time!

```<code>import React from "react";
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";

class DateRangeSelector extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
      showAll: true, // Set showAll to true by default
      startDate: null,
      endDate: null
    };

    this.handleCheckboxChange = this.handleCheckboxChange.bind(this);
    this.handleStartDateChange = this.handleStartDateChange.bind(this);
    this.handleEndDateChange = this.handleEndDateChange.bind(this);
  }

  handleCheckboxChange(event) {
    this.setState({
      showAll: event.target.checked
    });
  }

  handleStartDateChange(date) {
    this.setState({
      startDate: date
    });
  }

  handleEndDateChange(date) {
    this.setState({
      endDate: date
    });
  }

  render() {
    return (
      <form>
        <label>
          <input
            type="checkbox"
            checked={this.state.showAll}
            onChange={this.handleCheckboxChange}
          />
          Show all times
        </label>

        <br />
        <label>
          Start date:
          <DatePicker
            selected={this.state.startDate}
            onChange={this.handleStartDateChange}
          />
        </label>
        <br />
        <label>
          End date:
          <DatePicker
            selected={this.state.endDate}
            onChange={this.handleEndDateChange}
          />
        </label>
      </form>
    );
  }
}

const my_date_array =["12/07/2022", "11/30/2022","09/08/2022","04/07/2020", "11/04/1994"]

// Use the returned value to display a message to the user
const App = () => {
  return (
    <div>
    <DateRangeSelector />

  </div>

  );
};

export default App;
</code>```

Body:
I have the following lines of code that you can display quickly using https://codesandbox.io/s/react-new. Make sure to select the dependency "react-datepicker" from the down left corner:

What I have:

1 check box, and 2 date input boxes for users to select a specific date range.

What I want:

I have an array of dates ("my_date_array"), and I want a code to filter the dates based on the following conditions:

If the checkbox is selected, display all data.
If the checkbox is not selected, display only the data that is within the (inclusive) range of the user-selected start and end date.

The format does not matter I want to display filtered my_date_array based on the conditions on the screen below the input boxes.

One important note is that I want to be able to take the filtered date array outside the function and still be able to use it.

Here is what I have, Thank you for your time!

import React from "react";
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";

class DateRangeSelector extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
      showAll: true, // Set showAll to true by default
      startDate: null,
      endDate: null
    };

    this.handleCheckboxChange = this.handleCheckboxChange.bind(this);
    this.handleStartDateChange = this.handleStartDateChange.bind(this);
    this.handleEndDateChange = this.handleEndDateChange.bind(this);
  }

  handleCheckboxChange(event) {
    this.setState({
      showAll: event.target.checked
    });
  }

  handleStartDateChange(date) {
    this.setState({
      startDate: date
    });
  }

  handleEndDateChange(date) {
    this.setState({
      endDate: date
    });
  }

  render() {
    return (
      <form>

          <input
            type="checkbox"
            checked={this.state.showAll}
            onChange={this.handleCheckboxChange}
          />
          Show all times

          Start date:
          <DatePicker
            selected={this.state.startDate}
            onChange={this.handleStartDateChange}
          />

          End date:
          <DatePicker
            selected={this.state.endDate}
            onChange={this.handleEndDateChange}
          />

      </form>
    );
  }
}

const my_date_array =["12/07/2022", "11/30/2022","09/08/2022","04/07/2020", "11/04/1994"]

// Use the returned value to display a message to the user
const App = () => {
  return (

    <DateRangeSelector />

  );
};

export default App;


问:
Is there a way to define a requirements file for each lambda function in a serverless.yml in an AWS-Python environment?
We can do it at entire project level like:
`

```<code>custom:
  pkgfunc:
    buildDir: _build
    requirementsFile: "requirements.txt"
</code>```

but I needed to do something like:

```<code>functions:
  my_func:
    name: my_func
    handler: package.handler
    requirementsFile: "my_func_requirements.txt"

</code>```

I wanted to check if it's possible and if yes, then, how good of a solution this is.
My Primary objective is to reduce the lambda size as much as possible. Whichever lambda does not need a library should not get it packaged.

To reduce the stack size, I've separated some of the functions requiring huge libraries into different lambdas and I'm calling them internally via API/Boto calls.

Help is much appreciated.

Body:
We can do it at entire project level like:
`

custom:
  pkgfunc:
    buildDir: _build
    requirementsFile: "requirements.txt"

but I needed to do something like:

functions:
  my_func:
    name: my_func
    handler: package.handler
    requirementsFile: "my_func_requirements.txt"

I wanted to check if it's possible and if yes, then, how good of a solution this is.
My Primary objective is to reduce the lambda size as much as possible. Whichever lambda does not need a library should not get it packaged.

To reduce the stack size, I've separated some of the functions requiring huge libraries into different lambdas and I'm calling them internally via API/Boto calls.

Help is much appreciated.


问:
How to determine the transportation method from the history of latitude and longitude using Google Map API
■Prerequisites
The history of latitude, longitude, and elevation at regular intervals is stored in the DB.

We are investigating a method to determine the means of transportation from the history of latitude and longitude using Google Map API.
We are wondering if any of you know of any good solutions.
If you have any good ideas for methods other than Google Map API, we would appreciate it if you could share them with us.

Thank you.

We were investigating overview of Google Map API already.
But we don't have ideal to fix our problem.


问:
FCM's unsubscribeFromTopic returns success even if the deviceToken is not subscribed to a given topic
I am trying integrate FCM in an app, where I want to subscribe the deviceToken to a topic, and unsubscribe the tokens from a topic.

When I called the subscribe method, it returns success even for an already existing subscription (i.e.,) even when the deviceToken is already subscribed to the given topic. Similarly, when calling the unsubscribe method, it returns success even when there is no relation between the given topic and the deviceToken.

Shouldn't fail the request with 404 saying that the deviceToken is already subscribed and the deviceToken is not subscribed to the topic?

```<code>FirebaseMessaging.getInstance().subscribeToTopic("FCMTesting").addOnCompleteListener(task -> {
    if (task.isSuccessful()) {
        Log.d("Subscribe", "Successful");
    } else {
        //
    }
});
</code>```
```<code>FirebaseMessaging.getInstance().unsubscribeFromTopic("FCMTesting").addOnCompleteListener(task -> {
    if (task.isSuccessful()) {
        Log.d("Unsubscribe", "Successful");
    } else {
        //
    }

});
</code>```

Body:
I am trying integrate FCM in an app, where I want to subscribe the deviceToken to a topic, and unsubscribe the tokens from a topic.

When I called the subscribe method, it returns success even for an already existing subscription (i.e.,) even when the deviceToken is already subscribed to the given topic. Similarly, when calling the unsubscribe method, it returns success even when there is no relation between the given topic and the deviceToken.

Shouldn't fail the request with 404 saying that the deviceToken is already subscribed and the deviceToken is not subscribed to the topic?

FirebaseMessaging.getInstance().subscribeToTopic("FCMTesting").addOnCompleteListener(task -> {
    if (task.isSuccessful()) {
        Log.d("Subscribe", "Successful");
    } else {
        //
    }
});

FirebaseMessaging.getInstance().unsubscribeFromTopic("FCMTesting").addOnCompleteListener(task -> {
    if (task.isSuccessful()) {
        Log.d("Unsubscribe", "Successful");
    } else {
        //
    }

});


问:
Need to verify webhook in firebase cloud function (SHA-256)
I need a google cloud function that listens to a webhook from jobber(a CRM for small businesses). I have my https endpoint setup but decoding the Hmac header is giving me trouble.

Their docs posted in the solution in Ruby but not node.js

Here is their solution in Ruby. Any idea how I would implement this as a firebase function?

```<code>    MY_SECRET = "my apps secret"

# 'data' is the raw JSON payload
# 'hmac_header' is the base64 encoded header `X-Jobber-Hmac-SHA256`
def verify_webhook(data, hmac_header)
  digest = OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), MY_SECRET, data)
  calculated_hmac = Base64.strict_encode64(digest)

  # https://api.rubyonrails.org/classes/ActiveSupport/SecurityUtils.html
  # Compare strings of variable length, without exposing yourself to a timing attack
  ActiveSupport::SecurityUtils.secure_compare(calculated_hmac, hmac_header)
end

verify_webhook(
  "{\"data\":{\"webHookEvent\":{\"topic\":\"APP_CONNECT\",\"appId\":\"id\",\"accountId\":\"id\",\"itemId\":\"id\",\"occuredAt\":\"ISO8601DateTime\"}}}",
  "ks1dre6TCHsMO2GVWnDYmx3ZrxubXGbCNZ5gPiXvP9E="
)
# => returns boolean value which determines authenticity
</code>```

Body:
I need a google cloud function that listens to a webhook from jobber(a CRM for small businesses). I have my https endpoint setup but decoding the Hmac header is giving me trouble.

Their docs posted in the solution in Ruby but not node.js

Here is their solution in Ruby. Any idea how I would implement this as a firebase function?

    MY_SECRET = "my apps secret"

# 'data' is the raw JSON payload
# 'hmac_header' is the base64 encoded header `X-Jobber-Hmac-SHA256`
def verify_webhook(data, hmac_header)
  digest = OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), MY_SECRET, data)
  calculated_hmac = Base64.strict_encode64(digest)

  # https://api.rubyonrails.org/classes/ActiveSupport/SecurityUtils.html
  # Compare strings of variable length, without exposing yourself to a timing attack
  ActiveSupport::SecurityUtils.secure_compare(calculated_hmac, hmac_header)
end

verify_webhook(
  "{\"data\":{\"webHookEvent\":{\"topic\":\"APP_CONNECT\",\"appId\":\"id\",\"accountId\":\"id\",\"itemId\":\"id\",\"occuredAt\":\"ISO8601DateTime\"}}}",
  "ks1dre6TCHsMO2GVWnDYmx3ZrxubXGbCNZ5gPiXvP9E="
)
# => returns boolean value which determines authenticity


问:
query ORACLE database during springboot application no response
A sql like "SELECT COUNT(1) FROM tablename..." was executed by my springboot application with mybatis,but no response during a long time.

But when I executed the same sql directly in ORACLE,it worked and returned the response.

With executing these sql:
select event,count(*) from v$session_wait group by event order by 2 desc;

I found the 'latch:cache buffers chains' event.

I asked my frined and he told me that I can execute analyze table tablename compute statistics.

After executed the sql,the problem resolved,the select count sql executed by springboot application worked !

I feel puzzled,why the analyze sql worked?

Thank you.


问:
How to configure lifecycle for S3 incomplete multi-part upload
I've observed for failed multipart upload (like crash or stop in the middle), the partially uploaded object still exist in storage.

I want to configure lifecycle rules for these incomplete objects via either minio or S3 C++ SDk.

I want to configure something like

```<code>{
  "ID": "bucket-lifecycle-incomplete-chunk-upload",
  "Status": "Enabled",
  "NoncurrentVersionExpiration": {
    "NoncurrentDays": 1
  },
  "AbortIncompleteMultipartUpload": {
    "DaysAfterInitiation": 1
  }
},
</code>```

My C++ code looks like the following:

```<code>Aws::S3::Model::AbortIncompleteMultipartUpload incomplete_upload_config;
incomplete_upload_config.SetDaysAfterInitiation(days);

Aws::S3::Model::NoncurrentVersionExpiration version_expire;
version_expire.SetNoncurrentDays(1);

auto status = Aws::S3::Model::ExpirationStatus::Enabled;

Aws::S3::Model::LifecycleRule rule;
rule.SetID("bucket-lifecycle-incomplete-chunk-upload");
rule.SetStatus(std::move(status));
rule.SetNoncurrentVersionExpiration(std::move(version_expire));
rule.SetAbortIncompleteMultipartUpload(std::move(incomplete_upload_config));

Aws::S3::Model::BucketLifecycleConfiguration bkt_config;
bkt_config.AddRules(std::move(rule));

Aws::S3::Model::PutBucketLifecycleConfigurationRequest config_req{};
config_req.SetBucket(bucket);
config_req.SetLifecycleConfiguration(std::move(bkt_config));

auto outcome = client->PutBucketLifecycleConfiguration(config_req);
</code>```

And I get the following result:

```<code>Received HTTP return code: 400; Failed to update config for bucket <bucket-name> because MalformedXML: Unable to parse ExceptionName: MalformedXML Message:
</code>```

The pain point for this error is: I cannot find which additional or missing fields lead to this error.

Body:
I've observed for failed multipart upload (like crash or stop in the middle), the partially uploaded object still exist in storage.

I want to configure lifecycle rules for these incomplete objects via either minio or S3 C++ SDk.

I want to configure something like

{
  "ID": "bucket-lifecycle-incomplete-chunk-upload",
  "Status": "Enabled",
  "NoncurrentVersionExpiration": {
    "NoncurrentDays": 1
  },
  "AbortIncompleteMultipartUpload": {
    "DaysAfterInitiation": 1
  }
},

My C++ code looks like the following:

Aws::S3::Model::AbortIncompleteMultipartUpload incomplete_upload_config;
incomplete_upload_config.SetDaysAfterInitiation(days);

Aws::S3::Model::NoncurrentVersionExpiration version_expire;
version_expire.SetNoncurrentDays(1);

auto status = Aws::S3::Model::ExpirationStatus::Enabled;

Aws::S3::Model::LifecycleRule rule;
rule.SetID("bucket-lifecycle-incomplete-chunk-upload");
rule.SetStatus(std::move(status));
rule.SetNoncurrentVersionExpiration(std::move(version_expire));
rule.SetAbortIncompleteMultipartUpload(std::move(incomplete_upload_config));

Aws::S3::Model::BucketLifecycleConfiguration bkt_config;
bkt_config.AddRules(std::move(rule));

Aws::S3::Model::PutBucketLifecycleConfigurationRequest config_req{};
config_req.SetBucket(bucket);
config_req.SetLifecycleConfiguration(std::move(bkt_config));

auto outcome = client->PutBucketLifecycleConfiguration(config_req);

And I get the following result:

Received HTTP return code: 400; Failed to update config for bucket <bucket-name> because MalformedXML: Unable to parse ExceptionName: MalformedXML Message:

The pain point for this error is: I cannot find which additional or missing fields lead to this error.


问:
unable to understand ON in sql
```<code>SELECT y.id
FROM Weather x
LEFT JOIN Weather y ON x.Id +1 = y.Id
WHERE x.Temperature < y.Temperature
</code>```

this condition -> ON x.Id +1 = y.Id im confused how it works

Title: unable to understand ON in sql

Body:
SELECT y.id
FROM Weather x
LEFT JOIN Weather y ON x.Id +1 = y.Id
WHERE x.Temperature < y.Temperature

this condition -> ON x.Id +1 = y.Id im confused how it works


问:
Center image above text and make it responsive
I'm using MUI on React and want to make the image responsive and above the text when I use a smaller screen but I want the image on the left and text on the right when I'm using a bigger screen. I'm still new and I don't know how to make it work please help.

```<code>
<Grid container spacing={1} direction={{ xs: 'column', sm: 'column', md: 'row', lg: 'row', xl: 'row'}} textAlign='center' justifyContent='center' alignItems='center'>
 <Grid item xs={9} s={7} md={7} lg={7}>
  <Box fontSize={21}>
   <Parallax speed={10}>
    <Box p={6} className='aboutmebox' id='aboutme'>
     <p data-aos="fade-left"> **description here** </p>
    </Box>
   </Parallax>
  </Box>
 </Grid>

 <Grid item xs={3} md={5} lg={5} display='flex' justifyContent='center'>
  <img src='./images/me.jpg' height='60%' width='60%'
   data-aos="fade-up"
   data-aos-duration="8000"
   data-aos-offset="350"
   data-aos-anchor-placement="center-bottom"
  />
 </Grid>
</Grid>
</code>```

I tried using

```<code>direction={{ xs: 'column', sm: 'column', md: 'row', lg: 'row', xl: 'row'}}
</code>```

but all it does is put the image on the bottom when the screen is xs or sm.

I also tried typing the image first before the text but I want the image on the left side when i'm using a bigger screen.

Body:
I'm using MUI on React and want to make the image responsive and above the text when I use a smaller screen but I want the image on the left and text on the right when I'm using a bigger screen. I'm still new and I don't know how to make it work please help.

<Grid container spacing={1} direction={{ xs: 'column', sm: 'column', md: 'row', lg: 'row', xl: 'row'}} textAlign='center' justifyContent='center' alignItems='center'>
 <Grid item xs={9} s={7} md={7} lg={7}>
  <Box fontSize={21}>
   <Parallax speed={10}>
    <Box p={6} className='aboutmebox' id='aboutme'>

 **description here**

    </Box>
   </Parallax>
  </Box>
 </Grid>

 <Grid item xs={3} md={5} lg={5} display='flex' justifyContent='center'>

 </Grid>
</Grid>

I tried using

direction={{ xs: 'column', sm: 'column', md: 'row', lg: 'row', xl: 'row'}}

but all it does is put the image on the bottom when the screen is xs or sm.

I also tried typing the image first before the text but I want the image on the left side when i'm using a bigger screen.


问:
MISSING_EMAIL: Firebase REST API Auth /Node JS
I'm trying to use the firebase REST API for user authentication. I use NodeJS for this purpose. Here is my post request code:

app.post("/home", async (req, res) => {
  const reqBody = req.body;
  const api_req_body = {
    email: reqBody.email,
    password: reqBody.password,
    returnSecureToken: true,
  };
  response = await superagent
    .post(
      "https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=**********"
    )
    .set("Content-Type", "application/json")
    .send(api_req_body);
  console.log(response);
});
```
<p>CLIENT HTML CODE:
It's just a basic form that takes in username and password from the client and posts it to my server</p>
```

USER AND PASS

    <form method="post" action="/home" id="form" enctype="application/json">
        <input id="email" name="email" type="text" placeholder="enter email">
        <input type="text" id="password" name="password" placeholder="enter password">
        <button onclick="submitFunction()"> Submit</button>

    </form>

```
<p>Here is the error i get:</p>
```status: 400,
      text: '{\n' +
        '  "error": {\n' +
        '    "code": 400,\n' +
        '    "message": "MISSING_EMAIL",\n' +
        '    "errors": [\n' +
        '      {\n' +
        '        "message": "MISSING_EMAIL",\n' +
        '        "domain": "global",\n' +
        '        "reason": "invalid"\n' +
        '      }\n' +
        '    ]\n' +
        '  }\n' +
        '}\n',
      method: 'POST',
      path: '/v1/accounts:signInWithPassword?key=********'
    }
```

Any solution?

Body:
I'm trying to use the firebase REST API for user authentication. I use NodeJS for this purpose. Here is my post request code:

app.post("/home", async (req, res) => {
  const reqBody = req.body;
  const api_req_body = {
    email: reqBody.email,
    password: reqBody.password,
    returnSecureToken: true,
  };
  response = await superagent
    .post(
      "https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=**********"
    )
    .set("Content-Type", "application/json")
    .send(api_req_body);
  console.log(response);
});

CLIENT HTML CODE:
It's just a basic form that takes in username and password from the client and posts it to my server

USER AND PASS

    <form method="post" action="/home" id="form" enctype="application/json">
        <input id="email" name="email" type="text" placeholder="enter email">
        <input type="text" id="password" name="password" placeholder="enter password">
        <button onclick="submitFunction()"> Submit</button>

    </form>

Here is the error i get:

status: 400,
      text: '{\n' +
        '  "error": {\n' +
        '    "code": 400,\n' +
        '    "message": "MISSING_EMAIL",\n' +
        '    "errors": [\n' +
        '      {\n' +
        '        "message": "MISSING_EMAIL",\n' +
        '        "domain": "global",\n' +
        '        "reason": "invalid"\n' +
        '      }\n' +
        '    ]\n' +
        '  }\n' +
        '}\n',
      method: 'POST',
      path: '/v1/accounts:signInWithPassword?key=********'
    }

Any solution?


问:
Xamarin Android Binding : Kotlin extensions methods are not attached with Object after binding
I am creating Xamarin.Android Binding library from Kotlin AAR file.

Some of the extension methods are added to Context object in this library.

For Example,

Context.GetServiceType(){
...
}```
</div>
</div>
</p>
<p>While creating Binding library, i am getting below error in</p>
```Build Output for Extension methods
```

Kotlin: Renaming extension parameter
com/*/blesdk/extension/PermissionExtKt - bleSelfPermissionCheck -
$this$bleSelfPermissionCheck -> obj

Kotlin: Renaming extension parameter
com/*/blesdk/extension/PermissionExtKt - hasBLESupport -
$this$hasBLESupport -> obj

And, this extension methods are not added to Context Object.

Body:
I am creating Xamarin.Android Binding library from Kotlin AAR file.

Some of the extension methods are added to Context object in this library.

For Example,

Context.GetServiceType(){
...
}

While creating Binding library, i am getting below error in

Build Output for Extension methods

Kotlin: Renaming extension parameter
com/*/blesdk/extension/PermissionExtKt - bleSelfPermissionCheck -
$this$bleSelfPermissionCheck -> obj

Kotlin: Renaming extension parameter
com/*/blesdk/extension/PermissionExtKt - hasBLESupport -
$this$hasBLESupport -> obj

And, this extension methods are not added to Context Object.


问:
Dynamically update parts of SVG with Turbo Flask?
This is my first web dev project. I have a small flask app hosted on a Raspberry Pi. I'm using turbo-flask to send updated data to the client(s) every second. I am updating parts of 3 large SVGs over the turbo steam every second.

At times it stops working after a few minutes. I see a turbo steam 500 on my server. There's no detailed error message. On other occasions, the SVG rendering stutters and skips a few beats.

I guess the stream may be crashing/stuttering because the SVGs are quite large and rendered very frequently.

This is what my code looks like

flask_app.py

```<code>def update_data():
    """ Thread Body """
    with app.app_context():
        while True:
            time.sleep(DATA_UPDATE_TIME_STEP)
            read_data()  # Periodically read data

            # Update the HTML template with new data
            with app.test_request_context():
                turbo.push(turbo.replace(render_template('first-template.html'), 'first_data'))
                turbo.push(turbo.replace(render_template('second-template.html'), 'second_data'))
                turbo.push(turbo.replace(render_template('third-template.html'), 'third_data'))

</code>```

base-first.html (I have 3 base templates; one for each; they all look the same as below)

```<code><!DOCTYPE html>
<html>
   <head>
    {{turbo()}}
   </head>
   <body>
      {% include "first-template.html" %}
   </body>
</html>
</code>```

first-template.html

```<code>{% include "first.svg" %}
</code>```

first.svg

```<code><svg>
....
....
{bunch of svg code}
...
<g id = "first_data">
<text id="elapsed_secs" class="cls-27" transform="translate(100.00 100.00)"><tspan x="0" y="0">Heartbeat : {{elapsed_secs}}</tspan></text>
</g>
</svg>
</code>```

Note that the identifier for turbo steam is within the SVG element.

Following are my questions —

How do I fix the 500 error/stuttering?

How do I ensure turbo-flask only reloads only a part of my SVG?

Is there a better way to do this using JS/AJAX? In that case, I still need to feed updated data to javascript over turbo-flask.

Body:
This is my first web dev project. I have a small flask app hosted on a Raspberry Pi. I'm using turbo-flask to send updated data to the client(s) every second. I am updating parts of 3 large SVGs over the turbo steam every second.

At times it stops working after a few minutes. I see a turbo steam 500 on my server. There's no detailed error message. On other occasions, the SVG rendering stutters and skips a few beats.

I guess the stream may be crashing/stuttering because the SVGs are quite large and rendered very frequently.

This is what my code looks like

flask_app.py

def update_data():
    """ Thread Body """
    with app.app_context():
        while True:
            time.sleep(DATA_UPDATE_TIME_STEP)
            read_data()  # Periodically read data

            # Update the HTML template with new data
            with app.test_request_context():
                turbo.push(turbo.replace(render_template('first-template.html'), 'first_data'))
                turbo.push(turbo.replace(render_template('second-template.html'), 'second_data'))
                turbo.push(turbo.replace(render_template('third-template.html'), 'third_data'))

base-first.html (I have 3 base templates; one for each; they all look the same as below)

<!DOCTYPE html>

    {{turbo()}}

      {% include "first-template.html" %}

first-template.html

{% include "first.svg" %}

first.svg

<svg>
....
....
{bunch of svg code}
...
<g id = "first_data">
<text id="elapsed_secs" class="cls-27" transform="translate(100.00 100.00)"><tspan x="0" y="0">Heartbeat : {{elapsed_secs}}</tspan></text>
</g>
</svg>

Note that the identifier for turbo steam is within the SVG element.

Following are my questions —

How do I fix the 500 error/stuttering?

How do I ensure turbo-flask only reloads only a part of my SVG?

Is there a better way to do this using JS/AJAX? In that case, I still need to feed updated data to javascript over turbo-flask.


问:
Python Pandas - mapping CSV into another CSV
I have a CSV with some columns that I want to map into another CSV that has different columns using pandas.

Source CSV has following columns:

Target CSV has following columns:

My code so far looks like this:

#!/usr/bin/env python3
import pandas as pd
import csv
from pandas import DataFrame
header = ['ProductName', 'SKU', 'UPC', 'Quantity ', 'Description', 'CategoryId', 'VendorID', 'Brand', 'OriginalPrice ', 'Price', 'Images ', 'Variant_A_Name', 'Variant_A_SKU', 'Variant_A_Value', 'Variant_A_Images', 'Variant_A_Quantity', 'Variant_B_Name', 'Variant_B_SKU', 'Variant_B_Vaule', 'Variant_B_Images', 'Variant_B_Quantity', 'MetaTagTitle', 'MetaTagDescription', 'MetaTagKeyword', 'RelatedProductId']
with open('output.csv', 'w', encoding='UTF8') as f:
  writer = csv.writer(f)
# write the header
  writer.writerow(header)
# Load each file into a pandas dataframe
data1 = pd.read_csv("Emanuel.csv")
data2 = pd.read_csv("output.csv")

#Now add 'header$' from data1 to data2 to 'header$'
data2['ProductName'] = data1['title']
data2['Quantity'] = data1['title']
```

I have following issues:

the Quantity column gets duplicated

one column is blank and in the right place as the 4th column

one more column in the end with the values of data1['title'].

How can I fix this?

I want the Quantity to have the values in the right column which is the 4th column in the target CSV.

Body:
I have a CSV with some columns that I want to map into another CSV that has different columns using pandas.

Source CSV has following columns:

Target CSV has following columns:

My code so far looks like this:

#!/usr/bin/env python3
import pandas as pd
import csv
from pandas import DataFrame
header = ['ProductName', 'SKU', 'UPC', 'Quantity ', 'Description', 'CategoryId', 'VendorID', 'Brand', 'OriginalPrice ', 'Price', 'Images ', 'Variant_A_Name', 'Variant_A_SKU', 'Variant_A_Value', 'Variant_A_Images', 'Variant_A_Quantity', 'Variant_B_Name', 'Variant_B_SKU', 'Variant_B_Vaule', 'Variant_B_Images', 'Variant_B_Quantity', 'MetaTagTitle', 'MetaTagDescription', 'MetaTagKeyword', 'RelatedProductId']
with open('output.csv', 'w', encoding='UTF8') as f:
  writer = csv.writer(f)
# write the header
  writer.writerow(header)
# Load each file into a pandas dataframe
data1 = pd.read_csv("Emanuel.csv")
data2 = pd.read_csv("output.csv")

#Now add 'header$' from data1 to data2 to 'header$'
data2['ProductName'] = data1['title']
data2['Quantity'] = data1['title']

I have following issues:

the Quantity column gets duplicated

one column is blank and in the right place as the 4th column

one more column in the end with the values of data1['title'].

How can I fix this?

I want the Quantity to have the values in the right column which is the 4th column in the target CSV.


问:
Autocorrection of wrong spelled Partner name and product name, if available in a sentence with the help of existing dataset using AI/ML
I am working in a module where I Need to auto correct wrong spelled Partner name and Product Name (if available) in a query statement with the help of existing dataset in any form, using AI/ML.

So basically two actions are there which we need to do.

Finding wrong spelled Partner / Product Name based on category classification and context.

Correcting them.

Though, there are many paid apis available.

First, I need info on any available python lib which I can use with no cost specific to my requirement. If nothing is available free, then best paid api, which can exactly suit to this requirement.

Can anyone help me sharing the info which will be helpful for doing above.

Regards,
Kavita


问:
Reading a value from ADC buffer and creating graph on that with ePWM
I am new to CCS and C general. I have a problem to ask hope you can help me;
enter image description here

I want to add another ePWM (the third one) to the above project. The first ePWM already generates a 2kHz 25% duty cycle symmetric PWM waveform and the second ePWM triggers the ADC so we can read the values from ADC. When I add the third ePWM it should cycle the duty cycle (0-100%). What I want to do is read ePWM3 from AdcBuf and create a graph with that.

To do that, I set configurations on DefaultISR, ePWM, and ADC. However, it did not recognize the epwm3_info on update_compare in Default ISR. The error says it did not define but when I search it with CTRL it goes where I defined it. I did not understand why it gives the error. Can you help me?

Here is my code:

https://drive.google.com/drive/folders/1W12mHtPN2Mozj8K1pLLG2wNEUqT7QtBd


问:
Different window rcMonitor result from GetMonitorInfo window api in Microsoft Access and Microsoft Access Runtime 2013
I want to implement the access form to get the left right top bottom of the second screen through the window api for the calculation of the appbar when change scale display, but when I use Microsoft Access Runtime 2013 "GetMonitorInfo" to get the value of the current screen, the result is completely different from Microsoft Access. Is this normal? Is this the affect by the structure of Microsoft Access runtime? Why is it still affected by Microsoft Access runtime and Microsoft Access when using the window api directly?

Code

```<code>    ' 1.) Get current monitor hwnd from current form position
    lngCurrentMonitorHWnd = MonitorFromWindow(frmAccessForm.hwnd, MONITOR_DEFAULTTONULL)

    ' 2) Get current monitor info and logical size
    objCurrentMonitorInfo.cbSize = Len(objCurrentMonitorInfo)
    Call GetMonitorInfo(lngCurrentMonitorHWnd, objCurrentMonitorInfo)

    ' 3) Set current monitor info variable value
    mlngCurrentScreenLeft = objCurrentMonitorInfo.rcMonitor.Left
    mlngCurrentScreenRight = objCurrentMonitorInfo.rcMonitor.Right
    mlngCurrentScreenTop = objCurrentMonitorInfo.rcMonitor.Top
    mlngCurrentScreenBottom = objCurrentMonitorInfo.rcMonitor.Bottom
</code>```

Result of Microsoft Access 365/2019/2016/2013

100%

125%

Result of Microsoft Access Runtime 2013

100%

125%

Ways I've tried

Change MonitorFromWindow window handle property to window native file explorer (get by api-sam.exe), by pass acees hwnd to get monitor hwnd. but result still different in Microsoft Office runtime 2013

```<code>    ' 1.) Get current monitor hwnd from current form position
    lngCurrentMonitorHWnd = MonitorFromWindow(69911, MONITOR_DEFAULTTONULL)

    ' 2) Get current monitor info and logical size
    objCurrentMonitorInfo.cbSize = Len(objCurrentMonitorInfo)
    Call GetMonitorInfo(lngCurrentMonitorHWnd, objCurrentMonitorInfo)
</code>```

2.Change way to get monitor hwnd,use MonitorFromPoint to get current screen hwnd,but result still different in Microsoft Office runtime 2013.

```<code>    ' 1.) Get current monitor hwnd from current mouse position
    GetCursorPos objMousePoint
    lngCurrentMonitorHWnd = MonitorFromPoint(objMousePoint.x, objMousePoint.y,MONITOR_DEFAULTTOPRIMARY)

    ' 2) Get current monitor info and logical size
    objCurrentMonitorInfo.cbSize = Len(objCurrentMonitorInfo)
    Call GetMonitorInfo(lngCurrentMonitorHWnd, objCurrentMonitorInfo)
</code>```

Body:
I want to implement the access form to get the left right top bottom of the second screen through the window api for the calculation of the appbar when change scale display, but when I use Microsoft Access Runtime 2013 "GetMonitorInfo" to get the value of the current screen, the result is completely different from Microsoft Access. Is this normal? Is this the affect by the structure of Microsoft Access runtime? Why is it still affected by Microsoft Access runtime and Microsoft Access when using the window api directly?

Code

    ' 1.) Get current monitor hwnd from current form position
    lngCurrentMonitorHWnd = MonitorFromWindow(frmAccessForm.hwnd, MONITOR_DEFAULTTONULL)

    ' 2) Get current monitor info and logical size
    objCurrentMonitorInfo.cbSize = Len(objCurrentMonitorInfo)
    Call GetMonitorInfo(lngCurrentMonitorHWnd, objCurrentMonitorInfo)

    ' 3) Set current monitor info variable value
    mlngCurrentScreenLeft = objCurrentMonitorInfo.rcMonitor.Left
    mlngCurrentScreenRight = objCurrentMonitorInfo.rcMonitor.Right
    mlngCurrentScreenTop = objCurrentMonitorInfo.rcMonitor.Top
    mlngCurrentScreenBottom = objCurrentMonitorInfo.rcMonitor.Bottom

Result of Microsoft Access 365/2019/2016/2013

100%

125%

Result of Microsoft Access Runtime 2013

100%

125%

Ways I've tried

Change MonitorFromWindow window handle property to window native file explorer (get by api-sam.exe), by pass acees hwnd to get monitor hwnd. but result still different in Microsoft Office runtime 2013

    ' 1.) Get current monitor hwnd from current form position
    lngCurrentMonitorHWnd = MonitorFromWindow(69911, MONITOR_DEFAULTTONULL)

    ' 2) Get current monitor info and logical size
    objCurrentMonitorInfo.cbSize = Len(objCurrentMonitorInfo)
    Call GetMonitorInfo(lngCurrentMonitorHWnd, objCurrentMonitorInfo)

2.Change way to get monitor hwnd,use MonitorFromPoint to get current screen hwnd,but result still different in Microsoft Office runtime 2013.

    ' 1.) Get current monitor hwnd from current mouse position
    GetCursorPos objMousePoint
    lngCurrentMonitorHWnd = MonitorFromPoint(objMousePoint.x, objMousePoint.y,MONITOR_DEFAULTTOPRIMARY)

    ' 2) Get current monitor info and logical size
    objCurrentMonitorInfo.cbSize = Len(objCurrentMonitorInfo)
    Call GetMonitorInfo(lngCurrentMonitorHWnd, objCurrentMonitorInfo)


问:
Date format not coming in proper way in csv
I have a date coulmn in database which has data in below format -

"20221208121006"

I am saving this in a csv and it is getting changed to below format -

"2.01306E+14"

I tried to change the format to "yyyymmddhhmmss" using "format cell" in csv but it is changing to hash values like "#######"

Is there any other way to fix it?


问:
Nextjs link 3 copy of css . Anyone see this issue?
I have a page in app/dashboard directory in nextjs 13. But when i looked at head element of the page , it shows it has 3 links for same css. scss compiled into page.css but 3 links.

```<code>    "use client";
    import "./dashboard.scss";

    const Dashboard = () => {
          return (
            <div className="home">
            <div className="homeContainer">
       </div>
    </div>
     );
    };

     export default Dashboard;
</code>```

Body:
I have a page in app/dashboard directory in nextjs 13. But when i looked at head element of the page , it shows it has 3 links for same css. scss compiled into page.css but 3 links.

    "use client";
    import "./dashboard.scss";

    const Dashboard = () => {
          return (

     );
    };

     export default Dashboard;


问:
Run .sh file in windows for testing purpose
Are we able to run .sh files in our windows system to mimic how it will look like in server .

For an example : my .sh file that was place in server directory is at : /Users/mm13854/Desktop/FileCopy_Dec_122/cftp_tableau_filecopy/deploy/

makkau.sh contain of

```<code>echo "one $1  two   $2  three $3"
echo ${OUT}
</code>```

Running below Command in server will return the result that i want

```<code>APPID='11'
SAFE='DEV'
LDAP_GROUP='farid'

VALUE=subprocess.run(["sh","/Users/mm13854/Desktop/FileCopy_Dec_122/cftp_tableau_filecopy/deploy/makkau.sh",APPID,SAFE,LDAP_GROUP],capture_output=True,text=True).stdout.strip()
print(VALUE)
</code>```

This will then one 11 two dev three farid in my terminal which is perfectly fine, i am trying to mimic the same to be in my windows machine as i am doing some testing .

when i run below code , this will result in error .

```<code>VALUE=subprocess.run(["sh","C:/Users/mm13854/Desktop/FileCopy_Dec_122/cftp_tableau_filecopy/deploy/makkau.sh",APPID,SAFE,LDAP_GROUP],capture_output=True,text=True).stdout.strip()
</code>```

I also tried below approach but it failed

```<code>proc = subprocess.run(['/Users/mm13854/Desktop/FileCopy_Dec_122/cftp_tableau_filecopy/deploy/makkau.sh',APPID,SAFE,LDAP_GROUP],check=True, capture_output=True, text=True)
out = proc.stdout
print(out)
</code>```

Body:
Are we able to run .sh files in our windows system to mimic how it will look like in server .

For an example : my .sh file that was place in server directory is at : /Users/mm13854/Desktop/FileCopy_Dec_122/cftp_tableau_filecopy/deploy/

makkau.sh contain of

echo "one $1  two   $2  three $3"
echo ${OUT}

Running below Command in server will return the result that i want

APPID='11'
SAFE='DEV'
LDAP_GROUP='farid'

VALUE=subprocess.run(["sh","/Users/mm13854/Desktop/FileCopy_Dec_122/cftp_tableau_filecopy/deploy/makkau.sh",APPID,SAFE,LDAP_GROUP],capture_output=True,text=True).stdout.strip()
print(VALUE)

This will then one 11 two dev three farid in my terminal which is perfectly fine, i am trying to mimic the same to be in my windows machine as i am doing some testing .

when i run below code , this will result in error .

VALUE=subprocess.run(["sh","C:/Users/mm13854/Desktop/FileCopy_Dec_122/cftp_tableau_filecopy/deploy/makkau.sh",APPID,SAFE,LDAP_GROUP],capture_output=True,text=True).stdout.strip()

I also tried below approach but it failed

proc = subprocess.run(['/Users/mm13854/Desktop/FileCopy_Dec_122/cftp_tableau_filecopy/deploy/makkau.sh',APPID,SAFE,LDAP_GROUP],check=True, capture_output=True, text=True)
out = proc.stdout
print(out)


问:
Amplify Next JS deployment error : Could not initialize categories for 'production': The "path" argument must be of type string. Received undefined
I'm working on a NextJS project - that uses AWS Amplify for authentication, environment management & deployment. My NextJS frontend is connected to Amplify's production environment in an auto-deploy setup using my production branch on GitHub. This frontend is connected to Amplify backend production that I am using for authentication.

Amplify CLI Version - 10.5.1
Next JS version - 12.1.5-canary.7

This setup has been working since 2 months but since today, I am unable to actually even get past the "Backend" step on AWS Amplify deployments. Here is the error log that I am facing. The key error, I feel lies in the line - Could not initialize categories for 'production': The "path" argument must be of type string. Received undefined

```<code>2022-12-08T06:22:40.740Z [INFO]: [0mAmplify AppID found: d3k4n880hbvmjg. Amplify App name is: my-project-app-name[0m
    2022-12-08T06:22:40.787Z [INFO]: [0mBackend environment production found in Amplify Console app: my-project-app-name[0m
    2022-12-08T06:22:41.228Z [WARNING]: - Fetching updates to backend environment: production from the cloud.
    2022-12-08T06:22:41.510Z [WARNING]: - Building resource auth/coursemapfrontend
    2022-12-08T06:22:41.550Z [WARNING]: ✔ Successfully pulled backend environment production from the cloud.
    2022-12-08T06:22:41.905Z [WARNING]: ✖ There was an error initializing your environment.
    2022-12-08T06:22:41.907Z [INFO]:  Could not initialize categories for 'production': The "path" argument must be of type string. Received undefined
    2022-12-08T06:22:41.907Z [INFO]: Resolution: Review the error message and stack trace for additional information.
                                     Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
    2022-12-08T06:22:41.908Z [INFO]:
    2022-12-08T06:22:41.909Z [INFO]: Session Identifier: f49926f2-49c5-4601-95c3-f5a9c63375d9
    2022-12-08T06:22:42.524Z [ERROR]: !!! Build failed
    2022-12-08T06:22:42.524Z [ERROR]: !!! Non-Zero Exit Code detected
    2022-12-08T06:22:42.524Z [INFO]: # Starting environment caching...
    2022-12-08T06:22:42.524Z [INFO]: # Uploading environment cache artifact...
    2022-12-08T06:22:42.581Z [INFO]: # Uploaded environment cache artifact
    2022-12-08T06:22:42.582Z [INFO]: # Environment caching completed
    Terminating logging...
</code>```

Can someone please look at this and let me know what I can do to resolve this?

Body:
I'm working on a NextJS project - that uses AWS Amplify for authentication, environment management & deployment. My NextJS frontend is connected to Amplify's production environment in an auto-deploy setup using my production branch on GitHub. This frontend is connected to Amplify backend production that I am using for authentication.

Amplify CLI Version - 10.5.1
Next JS version - 12.1.5-canary.7

This setup has been working since 2 months but since today, I am unable to actually even get past the "Backend" step on AWS Amplify deployments. Here is the error log that I am facing. The key error, I feel lies in the line - Could not initialize categories for 'production': The "path" argument must be of type string. Received undefined

2022-12-08T06:22:40.740Z [INFO]: [0mAmplify AppID found: d3k4n880hbvmjg. Amplify App name is: my-project-app-name[0m
    2022-12-08T06:22:40.787Z [INFO]: [0mBackend environment production found in Amplify Console app: my-project-app-name[0m
    2022-12-08T06:22:41.228Z [WARNING]: - Fetching updates to backend environment: production from the cloud.
    2022-12-08T06:22:41.510Z [WARNING]: - Building resource auth/coursemapfrontend
    2022-12-08T06:22:41.550Z [WARNING]: ✔ Successfully pulled backend environment production from the cloud.
    2022-12-08T06:22:41.905Z [WARNING]: ✖ There was an error initializing your environment.
    2022-12-08T06:22:41.907Z [INFO]:  Could not initialize categories for 'production': The "path" argument must be of type string. Received undefined
    2022-12-08T06:22:41.907Z [INFO]: Resolution: Review the error message and stack trace for additional information.
                                     Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
    2022-12-08T06:22:41.908Z [INFO]:
    2022-12-08T06:22:41.909Z [INFO]: Session Identifier: f49926f2-49c5-4601-95c3-f5a9c63375d9
    2022-12-08T06:22:42.524Z [ERROR]: !!! Build failed
    2022-12-08T06:22:42.524Z [ERROR]: !!! Non-Zero Exit Code detected
    2022-12-08T06:22:42.524Z [INFO]: # Starting environment caching...
    2022-12-08T06:22:42.524Z [INFO]: # Uploading environment cache artifact...
    2022-12-08T06:22:42.581Z [INFO]: # Uploaded environment cache artifact
    2022-12-08T06:22:42.582Z [INFO]: # Environment caching completed
    Terminating logging...

Can someone please look at this and let me know what I can do to resolve this?


问:
Access com interop objects through jint
We are looking at implementing Jint in our .net application and it looks to be a great solution.  The issue we are facing is how jint access objects from com where .net has created a com wrapper around the objects.  When we look at the objects in jint they are seen as System.__ComObject objects.

This means that we are unable to access any of the properties on these objects.

.net code

```<code>   Dim dic = New scripting.dictionary
    Me.ScriptEngineJINT.SetValue("dic", dic)
</code>```

Java script code - this does not work as .count and .add can't be seen.  the dic reference object type is seen as system.__comObject rather then scripting.dictionary as it would be seen in .net.

```<code>function runComTest() {
                    dic.Add("1", "Example");
                    var c = dic.Count
                    if (dic.Exists("1")) {
                           var val = dic.Item("1")
                           return val
                    }
    }
</code>```

I can create a helper function that I can call back into .net and use reflection to make the call - but not a very good solution.  Ideally if we could simply access the properties on com objects as we would within .net it would be ideal.

We are using .net framework 4.6.2

Title: Access com interop objects through jint

Body:
We are looking at implementing Jint in our .net application and it looks to be a great solution.  The issue we are facing is how jint access objects from com where .net has created a com wrapper around the objects.  When we look at the objects in jint they are seen as System.__ComObject objects.

This means that we are unable to access any of the properties on these objects.

.net code

   Dim dic = New scripting.dictionary
    Me.ScriptEngineJINT.SetValue("dic", dic)

Java script code - this does not work as .count and .add can't be seen.  the dic reference object type is seen as system.__comObject rather then scripting.dictionary as it would be seen in .net.

function runComTest() {
                    dic.Add("1", "Example");
                    var c = dic.Count
                    if (dic.Exists("1")) {
                           var val = dic.Item("1")
                           return val
                    }
    }

I can create a helper function that I can call back into .net and use reflection to make the call - but not a very good solution.  Ideally if we could simply access the properties on com objects as we would within .net it would be ideal.

We are using .net framework 4.6.2


问:
How to know what the executed methods are when a specific button is clicked?
I am currently in a situation where I need to find what methods are executed when a specific button is clicked.

I have traced the method that binds to the button but there are too many places that it links to. Is there any way to list all of them; so that I can check them individually?

Right now, I am tracking the code in model but when it comes to the methods that use depends, that can't be easily traced.

What makes it so difficult is that the Odoo server here currently has hundreds of customized modules.


问:
How to join the three tables in spring data jpa
I am fairly new to Spring Boot. I am trying to join a bunch of tables and get some data back. I have created the entities and repositories for the three tables I am working with. Below is the query I am trying to achieve.

```<code>                   SELECT *
                   FROM  PEFT_LINE PLI
                   JOIN  PEFT_LINE_RELTN PLICR
                   ON  PLICR.PEFT_LINE_ID   = PLI.PEFT_LINE_ID
                   JOIN  PEFT_CHARGE PC
                   ON  PC.PEFT_CHRG_ID      = PLICR.PEFT_CHRG_ID
</code>```

I have created the entity classes for PEFT_LINE, PEFT_LINE_RELTN and PEFT_CHARGE where PEFT_LINE_RELTN contains the foreign key of both PEFT_LINE and PEFT_CHARGE, and I have established the bidirectional mapping between the three tables.

Entity class for PEFT_LINE

```<code>            @Entity
            public class PEFT_LINE

            @Id
            private int PeftId;
            private int ProcCode;

            @OneToMany(mappedBy = "PEFT_LINE",fetch =FetchType.LAZY,cascade=CascadeType.ALL)
            @JsonManagedReference("PEFT_LINE")
            private List<PEFT_LINE_RELTN> peft_line_reltn;

            ***getters and setters
</code>```

Entity class for PEFT_LINE_RELTN

```<code>            @Entity
            public class PEFT_LINE_RELTN

            @Id
            private int PeftlineId;
            private int ActiveCd;

            @ManyToOne(fetch = FetchType.LAZY,cascade = CascadeType.ALL)
            @JoinColumn(name = "fk_peftId")
            @JsonBackReference("PEFT_LINE")
            private PEFT_LINE peftItem;

            @ManyToOne(fetch = FetchType.LAZY,cascade = CascadeType.ALL)
            @JoinColumn(name = "fk_peftchrgId")
            @JsonBackReference("PEFT_CHARGE")
            private PEFT_CHARGE peftCharge;

            ..getters and setters
</code>```

Entity class for PEFT_CHARGE

```<code>            @Entity
            public class PEFT_CHARGE

            @Id
            private int PeftchrgId;
            private int ActiveCode;

            @OneToMany(mappedBy ="PEFT_CHARGE",fetch =FetchType.LAZY,cascade=CascadeType.ALL)
            @JsonManagedReference("PEFT_CHARGE")
            private List<PEFT_LINE_RELTN> peft_line_reltn
            **getters and setters
</code>```

PEFT_LINE Repository

```<code>            public interface PEFT_LINERepo extends JpaRepository<PeftId, Integer>{

            }
</code>```

I am trying to store the data in the tables. Firstly, when I am trying to send the peft_line request structure such that the peft_line_reltn foreign key also get's inserted.
Request structure for peft_line

```<code>                          [
                          {
                            "PeftId" : 44,
                            "ProcCode" : 96,
                                "peft_line_reltn":[
                                                   {
                                                    "PeftlineId" : 652,
                                                    "ActiveCd" : 1
                                                   }
                                                  ]
                           }
                           ]
</code>```

This successfully inserts in both pft_line and pft_line_reltn table

```<code>                     After insertion
                     pft_line
                     PeftId     ProcCode
                      44           96

                     pft_line_reltn
                     PeftlineId    ActiveCd    fk_peftId    fk_peftchrgId
                      652              1           44            null

                    Request structure for peft_charge
                           [
                           {
                             "PeftchrgId" : 57,
                             "ActiveCode" : 79,
                             "peft_line_reltn":[
                                                 {
                                                   "PeftlineId" : 652,
                                                   "ActiveCd" : 1

                                                 }
                                                 ]
                           }
                           ]

                        After insertion
                        peft_charge table
                        PeftchrgId    ActiveCode
                          57              79

                        pft_line_reltn table
                        PeftlineId    ActiveCd    fk_peftId    fk_peftchrgId
                            652              1           null            57
</code>```

When the insertion happens in the PEFT_LINE_RELTN the foreign key fk_peftId will be stored as null. Please let me know if I am missing out anything here or is there another way to accomplish this. Thanks in advance.

Table schemas:

```<code>          PEFT_LINE : PeftId(Primary key)

          PEFT_LINE_RELTN : PeftlineId(Primary key)
          fk_peftId(foreign key)
          fk_peftchrgId(foreign key)

          PEFT_CHARGE : PeftchrgId(Primary key)
</code>```

Body:
I am fairly new to Spring Boot. I am trying to join a bunch of tables and get some data back. I have created the entities and repositories for the three tables I am working with. Below is the query I am trying to achieve.

                   SELECT *
                   FROM  PEFT_LINE PLI
                   JOIN  PEFT_LINE_RELTN PLICR
                   ON  PLICR.PEFT_LINE_ID   = PLI.PEFT_LINE_ID
                   JOIN  PEFT_CHARGE PC
                   ON  PC.PEFT_CHRG_ID      = PLICR.PEFT_CHRG_ID

I have created the entity classes for PEFT_LINE, PEFT_LINE_RELTN and PEFT_CHARGE where PEFT_LINE_RELTN contains the foreign key of both PEFT_LINE and PEFT_CHARGE, and I have established the bidirectional mapping between the three tables.

Entity class for PEFT_LINE

            @Entity
            public class PEFT_LINE

            @Id
            private int PeftId;
            private int ProcCode;

            @OneToMany(mappedBy = "PEFT_LINE",fetch =FetchType.LAZY,cascade=CascadeType.ALL)
            @JsonManagedReference("PEFT_LINE")
            private List<PEFT_LINE_RELTN> peft_line_reltn;

            ***getters and setters

Entity class for PEFT_LINE_RELTN

            @Entity
            public class PEFT_LINE_RELTN

            @Id
            private int PeftlineId;
            private int ActiveCd;

            @ManyToOne(fetch = FetchType.LAZY,cascade = CascadeType.ALL)
            @JoinColumn(name = "fk_peftId")
            @JsonBackReference("PEFT_LINE")
            private PEFT_LINE peftItem;

            @ManyToOne(fetch = FetchType.LAZY,cascade = CascadeType.ALL)
            @JoinColumn(name = "fk_peftchrgId")
            @JsonBackReference("PEFT_CHARGE")
            private PEFT_CHARGE peftCharge;

            ..getters and setters

Entity class for PEFT_CHARGE

            @Entity
            public class PEFT_CHARGE

            @Id
            private int PeftchrgId;
            private int ActiveCode;

            @OneToMany(mappedBy ="PEFT_CHARGE",fetch =FetchType.LAZY,cascade=CascadeType.ALL)
            @JsonManagedReference("PEFT_CHARGE")
            private List<PEFT_LINE_RELTN> peft_line_reltn
            **getters and setters

PEFT_LINE Repository

            public interface PEFT_LINERepo extends JpaRepository<PeftId, Integer>{

            }

I am trying to store the data in the tables. Firstly, when I am trying to send the peft_line request structure such that the peft_line_reltn foreign key also get's inserted.
Request structure for peft_line

                          [
                          {
                            "PeftId" : 44,
                            "ProcCode" : 96,
                                "peft_line_reltn":[
                                                   {
                                                    "PeftlineId" : 652,
                                                    "ActiveCd" : 1
                                                   }
                                                  ]
                           }
                           ]

This successfully inserts in both pft_line and pft_line_reltn table

                     After insertion
                     pft_line
                     PeftId     ProcCode
                      44           96

                     pft_line_reltn
                     PeftlineId    ActiveCd    fk_peftId    fk_peftchrgId
                      652              1           44            null

                    Request structure for peft_charge
                           [
                           {
                             "PeftchrgId" : 57,
                             "ActiveCode" : 79,
                             "peft_line_reltn":[
                                                 {
                                                   "PeftlineId" : 652,
                                                   "ActiveCd" : 1

                                                 }
                                                 ]
                           }
                           ]

                        After insertion
                        peft_charge table
                        PeftchrgId    ActiveCode
                          57              79

                        pft_line_reltn table
                        PeftlineId    ActiveCd    fk_peftId    fk_peftchrgId
                            652              1           null            57

When the insertion happens in the PEFT_LINE_RELTN the foreign key fk_peftId will be stored as null. Please let me know if I am missing out anything here or is there another way to accomplish this. Thanks in advance.

Table schemas:

          PEFT_LINE : PeftId(Primary key)

          PEFT_LINE_RELTN : PeftlineId(Primary key)
          fk_peftId(foreign key)
          fk_peftchrgId(foreign key)

          PEFT_CHARGE : PeftchrgId(Primary key)


问:
How do i break the upload to s3 if values are not getting uploaded to the server
I have a code to upload the data to the server and due to any condition if few values are not uploaded to the server I want the later code which uploads data to s3 also to upload the same value. Ex : imagine i am uploading [1,2,3,4,5,6] to the server from lambda for some reason 2,3 didn't get uploaded. Instead of the full list getting uploaded to s3 i want the same values to get uploaded ad server. how do I do that?

```<code>if df.shape[0] > 0:
 for i in range(len(df)):
  values = f"{df['RMA'][i]},.
 {df['serial_number'][i]},.
 {df['code_type'][i]},{df['date_opened'][i]},{df['created_by'][i]},{df['rma_customer'][i]},{df['acacia_component_pn'][i]},{df['component_engineer'][i]},{df['product_engineer'][i]},{df['qty'][i]},{df['test_process'][i]},{df['reference'][i]},{df['component_supplier_name'][i]},{df['component_supplier_pn'][i]},{df['component_supplier_date_code'][i]},\ {df['component_supplier_lot_code'][i]},{df['severity_class'][i]},{df['component_failure_detail'][i]},{df['supplier_RMA'][i]},{df['fa_owner'][i]},{df['AW_ref_bill'][i]},{df['component_shipped_to_supplier'][i]},{df['component_received_by_supplier'][i]},{df['supplier_fa_received'][i]},{df['is_active'][i]},{df['cfar_open_date'][i]},{df['cfar_closed_date'][i]},{df['Unit_Fault_Diagnosis'][i]}"

 response = client.service.fn_Log("279", "xyz", "xyz", "RMA", "xyz", "1", parameters, values, ",")
if (response.Message != None) | (response.Result != 'True'): logger.error(i) logger.error(values) logger.error(response)
</code>```

this is the code to upload to the server and for uploading to s3 ill directly upload

upload_to_s3(df, 'xyz/xyz.csv')

Body:
I have a code to upload the data to the server and due to any condition if few values are not uploaded to the server I want the later code which uploads data to s3 also to upload the same value. Ex : imagine i am uploading [1,2,3,4,5,6] to the server from lambda for some reason 2,3 didn't get uploaded. Instead of the full list getting uploaded to s3 i want the same values to get uploaded ad server. how do I do that?

if df.shape[0] > 0:
 for i in range(len(df)):
  values = f"{df['RMA'][i]},.
 {df['serial_number'][i]},.
 {df['code_type'][i]},{df['date_opened'][i]},{df['created_by'][i]},{df['rma_customer'][i]},{df['acacia_component_pn'][i]},{df['component_engineer'][i]},{df['product_engineer'][i]},{df['qty'][i]},{df['test_process'][i]},{df['reference'][i]},{df['component_supplier_name'][i]},{df['component_supplier_pn'][i]},{df['component_supplier_date_code'][i]},\ {df['component_supplier_lot_code'][i]},{df['severity_class'][i]},{df['component_failure_detail'][i]},{df['supplier_RMA'][i]},{df['fa_owner'][i]},{df['AW_ref_bill'][i]},{df['component_shipped_to_supplier'][i]},{df['component_received_by_supplier'][i]},{df['supplier_fa_received'][i]},{df['is_active'][i]},{df['cfar_open_date'][i]},{df['cfar_closed_date'][i]},{df['Unit_Fault_Diagnosis'][i]}"

 response = client.service.fn_Log("279", "xyz", "xyz", "RMA", "xyz", "1", parameters, values, ",")
if (response.Message != None) | (response.Result != 'True'): logger.error(i) logger.error(values) logger.error(response)

this is the code to upload to the server and for uploading to s3 ill directly upload

upload_to_s3(df, 'xyz/xyz.csv')


问:
CSS animation-fill-mode: forwards not working
I am trying to create a codepen where I have a circle that moves in a circular path based on its parent div getting rotated. I rotate the text inside the circle in the opposite direction at the same rate so that it create the allusion that the text does not rotate at all and stay upright. However, I would like to add an animation that pulses when I am hovering over the circle. I was able to do this, but the problem is that the text is then changing back to its original rotation (which is based on the orientation of the circle, and the text will not be upright).
Here is my code for anyone to replicate

HTML

```<code><div class="container">
  <div class="parent">
    <div class="child">
      <p>Word</p>
    </div>
  </div>
</div>
</code>```

CSS

```<code>.container {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: blue;
}
.parent {
  display: flex;
  align-items: center;
/*   justify-content: center; */
  background-color: red;
  width: 600px;
  height: 600px;
  animation: square-rotate 30s linear infinite;
  pointer-events: none;
}
@keyframes square-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.child {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  pointer-events: auto;
}
p {
  animation: text-rotate 30s linear infinite forwards;
  animation-fill-mode: forwards;
  pointer-events: auto
}
@keyframes text-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}
.parent:hover {
  background-color: green;
  animation-play-state: paused;
}
.child:hover p {
/*   animation-play-state: paused; */
  animation: pulse 1s linear infinite;
}
@keyframes pulse {
  0% {
    transform:scale(1);
  }
  50% {
    transform:scale(1.3);
  }
  100% {
    transform:scale(1);
  }
}
</code>```

What exactly am I missing here? I need the text to not reset back to its rotation according to the white circle and just go through the pulse animation at whatever rotation it was in when my pointer hovers over the element.

Body:
I am trying to create a codepen where I have a circle that moves in a circular path based on its parent div getting rotated. I rotate the text inside the circle in the opposite direction at the same rate so that it create the allusion that the text does not rotate at all and stay upright. However, I would like to add an animation that pulses when I am hovering over the circle. I was able to do this, but the problem is that the text is then changing back to its original rotation (which is based on the orientation of the circle, and the text will not be upright).
Here is my code for anyone to replicate

HTML

Word

CSS

.container {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: blue;
}
.parent {
  display: flex;
  align-items: center;
/*   justify-content: center; */
  background-color: red;
  width: 600px;
  height: 600px;
  animation: square-rotate 30s linear infinite;
  pointer-events: none;
}
@keyframes square-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.child {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  pointer-events: auto;
}
p {
  animation: text-rotate 30s linear infinite forwards;
  animation-fill-mode: forwards;
  pointer-events: auto
}
@keyframes text-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}
.parent:hover {
  background-color: green;
  animation-play-state: paused;
}
.child:hover p {
/*   animation-play-state: paused; */
  animation: pulse 1s linear infinite;
}
@keyframes pulse {
  0% {
    transform:scale(1);
  }
  50% {
    transform:scale(1.3);
  }
  100% {
    transform:scale(1);
  }
}

What exactly am I missing here? I need the text to not reset back to its rotation according to the white circle and just go through the pulse animation at whatever rotation it was in when my pointer hovers over the element.


问:
unable to get repr for <class 'albumentations.core.composition.compose'>
I am trying to run a code repository downloaded from GitHub as it is mentioned in the instruction of that but getting following error.
TypeError: init() missing 1 required positional argument: 'image_paths'
I am having this error at the code line 63 (preprocessing = preprocessing).
When I srat the program in debug mode I shows following error
unable to get repr for <class 'albumentations.core.composition.compose'>

```<code>import matplotlib.pyplot as plt
import numpy as np
import os
import sys
import torch

from skimage import io

from utils import adjust_sar_contrast, compute_building_score, plot_images

sys.path.append('/home/salman/Downloads/SpaceNet_SAR_Buildings_Solutions-master/4-motokimura/tmp/work')
from spacenet6_model.configs.load_config import get_config_with_previous_experiment
from spacenet6_model.datasets import SpaceNet6TestDataset
from spacenet6_model.models import get_model
from spacenet6_model.transforms import get_augmentation, get_preprocess

# select previous experiment to load
exp_id = 14
exp_log_dir = "/home/salman/Downloads/SpaceNet_SAR_Buildings_Solutions-master/4-motokimura/tmp/logs"  # None: use default

# select device to which the model is loaded
cuda = True
if cuda:
    device = 'cuda'
    os.environ['CUDA_VISIBLE_DEVICES'] = '0'
else:
    device = 'cpu'
    os.environ['CUDA_VISIBLE_DEVICES'] = ''

# overwrite default config with previous experiment
config = get_config_with_previous_experiment(exp_id=exp_id, exp_log_dir=exp_log_dir)

# overwrite additional hyper parameters
config.MODEL.DEVICE = device

config.WEIGHT_ROOT = "/home/salman/Downloads/SpaceNet_SAR_Buildings_Solutions-master/4-motokimura/tmp/weights/"
config.MODEL.WEIGHT = f"/home/salman/Downloads/SpaceNet_SAR_Buildings_Solutions-master/4-motokimura/tmp/weights/exp_{exp_id:04d}/model_best.pth"
config.INPUT.MEAN_STD_DIR = "/home/salman/Downloads/SpaceNet_SAR_Buildings_Solutions-master/4-motokimura/tmp/work/models/image_mean_std/"
config.INPUT.TEST_IMAGE_DIR = "/home/salman/data/SN6_buildings_AOI_11_Rotterdam_test_public/test_public/AOI_11_Rotterdam/SAR-Intensity"
config.INPUT.SAR_ORIENTATION="/home/salman/Downloads/SpaceNet_SAR_Buildings_Solutions-master/4-motokimura/tmp/work/static/SAR_orientations.txt"
config.TRAIN_VAL_SPLIT_DIR="/home/salman/Downloads/data/spacenet6/split"
config.PREDICTION_ROOT="/home/salman/Downloads/data/spacenet6/predictions"
config.POLY_CSV_ROOT="/home/salman/Downloads/data/spacenet6/polygons"
config.CHECKPOINT_ROOT="/home/salman/Downloads/data/spacenet6/ceckpoints"
config.POLY_OUTPUT_PATH="/home/salman/Downloads/data/spacenet6/val_polygons"
config.freeze()

print(config)

model = get_model(config)
model.eval();

from glob import glob
image_paths = glob(os.path.join(config.INPUT.TEST_IMAGE_DIR, "*.tif"))
#print(image_paths)

preprocessing = get_preprocess(config, is_test=True)
augmentation = get_augmentation(config, is_train=False)

test_dataset = SpaceNet6TestDataset(
    config,
    augmentation=augmentation,
    preprocessing=preprocessing
)

test_dataset_vis = SpaceNet6TestDataset(
    config,
    augmentation=augmentation,
    preprocessing=None
)

channel_footprint = config.INPUT.CLASSES.index('building_footprint')
channel_boundary = config.INPUT.CLASSES.index('building_boundary')

score_thresh = 0.5
alpha = 1.0

start_index = 900
N = 20

for i in range(start_index, start_index + N):
    image_vis = test_dataset_vis[i]['image']
    image = test_dataset[i]['image']

    x_tensor = image.unsqueeze(0).to(config.MODEL.DEVICE)
    pr_score = model.module.predict(x_tensor)
    pr_score = pr_score.squeeze().cpu().numpy()

    pr_score_building = compute_building_score(
        pr_score[channel_footprint],
        pr_score[channel_boundary],
        alpha=alpha
    )
    pr_mask = pr_score_building > score_thresh

    rotated = test_dataset[i]['rotated']
    if rotated:
        image_vis = np.flipud(np.fliplr(image_vis))
        pr_mask = np.flipud(np.fliplr(pr_mask))

    plot_images(
        SAR_intensity_0=(adjust_sar_contrast(image_vis[:, :, 0]), 'gray'),
        building_mask_pr=(pr_mask, 'viridis')
    )
</code>```

The function which this code calls is given below:

```<code>def get_spacenet6_preprocess(config, is_test):
    """
    """
    mean_path = os.path.join(
        config.INPUT.MEAN_STD_DIR,
        config.INPUT.IMAGE_TYPE,
        'mean.npy'
    )
    mean = np.load(mean_path)
    mean = mean[np.newaxis, np.newaxis, :]

    std_path = os.path.join(
        config.INPUT.MEAN_STD_DIR,
        config.INPUT.IMAGE_TYPE,
        'std.npy'
    )
    std = np.load(std_path)
    std = std[np.newaxis, np.newaxis, :]

    if is_test:
        to_tensor = albu.Lambda(
            image=functools.partial(_to_tensor)
        )
    else:
        to_tensor = albu.Lambda(
            image=functools.partial(_to_tensor),
            mask=functools.partial(_to_tensor)
        )

    preprocess = [
        albu.Lambda(
            image=functools.partial(
                _normalize_image,
                mean=mean,
                std=std
            )
        ),
        to_tensor,
    ]
    return albu.Compose(preprocess)
</code>```

Body:
I am trying to run a code repository downloaded from GitHub as it is mentioned in the instruction of that but getting following error.
TypeError: init() missing 1 required positional argument: 'image_paths'
I am having this error at the code line 63 (preprocessing = preprocessing).
When I srat the program in debug mode I shows following error
unable to get repr for <class 'albumentations.core.composition.compose'>

import matplotlib.pyplot as plt
import numpy as np
import os
import sys
import torch

from skimage import io

from utils import adjust_sar_contrast, compute_building_score, plot_images

sys.path.append('/home/salman/Downloads/SpaceNet_SAR_Buildings_Solutions-master/4-motokimura/tmp/work')
from spacenet6_model.configs.load_config import get_config_with_previous_experiment
from spacenet6_model.datasets import SpaceNet6TestDataset
from spacenet6_model.models import get_model
from spacenet6_model.transforms import get_augmentation, get_preprocess

# select previous experiment to load
exp_id = 14
exp_log_dir = "/home/salman/Downloads/SpaceNet_SAR_Buildings_Solutions-master/4-motokimura/tmp/logs"  # None: use default

# select device to which the model is loaded
cuda = True
if cuda:
    device = 'cuda'
    os.environ['CUDA_VISIBLE_DEVICES'] = '0'
else:
    device = 'cpu'
    os.environ['CUDA_VISIBLE_DEVICES'] = ''

# overwrite default config with previous experiment
config = get_config_with_previous_experiment(exp_id=exp_id, exp_log_dir=exp_log_dir)

# overwrite additional hyper parameters
config.MODEL.DEVICE = device

config.WEIGHT_ROOT = "/home/salman/Downloads/SpaceNet_SAR_Buildings_Solutions-master/4-motokimura/tmp/weights/"
config.MODEL.WEIGHT = f"/home/salman/Downloads/SpaceNet_SAR_Buildings_Solutions-master/4-motokimura/tmp/weights/exp_{exp_id:04d}/model_best.pth"
config.INPUT.MEAN_STD_DIR = "/home/salman/Downloads/SpaceNet_SAR_Buildings_Solutions-master/4-motokimura/tmp/work/models/image_mean_std/"
config.INPUT.TEST_IMAGE_DIR = "/home/salman/data/SN6_buildings_AOI_11_Rotterdam_test_public/test_public/AOI_11_Rotterdam/SAR-Intensity"
config.INPUT.SAR_ORIENTATION="/home/salman/Downloads/SpaceNet_SAR_Buildings_Solutions-master/4-motokimura/tmp/work/static/SAR_orientations.txt"
config.TRAIN_VAL_SPLIT_DIR="/home/salman/Downloads/data/spacenet6/split"
config.PREDICTION_ROOT="/home/salman/Downloads/data/spacenet6/predictions"
config.POLY_CSV_ROOT="/home/salman/Downloads/data/spacenet6/polygons"
config.CHECKPOINT_ROOT="/home/salman/Downloads/data/spacenet6/ceckpoints"
config.POLY_OUTPUT_PATH="/home/salman/Downloads/data/spacenet6/val_polygons"
config.freeze()

print(config)

model = get_model(config)
model.eval();

from glob import glob
image_paths = glob(os.path.join(config.INPUT.TEST_IMAGE_DIR, "*.tif"))
#print(image_paths)

preprocessing = get_preprocess(config, is_test=True)
augmentation = get_augmentation(config, is_train=False)

test_dataset = SpaceNet6TestDataset(
    config,
    augmentation=augmentation,
    preprocessing=preprocessing
)

test_dataset_vis = SpaceNet6TestDataset(
    config,
    augmentation=augmentation,
    preprocessing=None
)

channel_footprint = config.INPUT.CLASSES.index('building_footprint')
channel_boundary = config.INPUT.CLASSES.index('building_boundary')

score_thresh = 0.5
alpha = 1.0

start_index = 900
N = 20

for i in range(start_index, start_index + N):
    image_vis = test_dataset_vis[i]['image']
    image = test_dataset[i]['image']

    x_tensor = image.unsqueeze(0).to(config.MODEL.DEVICE)
    pr_score = model.module.predict(x_tensor)
    pr_score = pr_score.squeeze().cpu().numpy()

    pr_score_building = compute_building_score(
        pr_score[channel_footprint],
        pr_score[channel_boundary],
        alpha=alpha
    )
    pr_mask = pr_score_building > score_thresh

    rotated = test_dataset[i]['rotated']
    if rotated:
        image_vis = np.flipud(np.fliplr(image_vis))
        pr_mask = np.flipud(np.fliplr(pr_mask))

    plot_images(
        SAR_intensity_0=(adjust_sar_contrast(image_vis[:, :, 0]), 'gray'),
        building_mask_pr=(pr_mask, 'viridis')
    )

The function which this code calls is given below:

def get_spacenet6_preprocess(config, is_test):
    """
    """
    mean_path = os.path.join(
        config.INPUT.MEAN_STD_DIR,
        config.INPUT.IMAGE_TYPE,
        'mean.npy'
    )
    mean = np.load(mean_path)
    mean = mean[np.newaxis, np.newaxis, :]

    std_path = os.path.join(
        config.INPUT.MEAN_STD_DIR,
        config.INPUT.IMAGE_TYPE,
        'std.npy'
    )
    std = np.load(std_path)
    std = std[np.newaxis, np.newaxis, :]

    if is_test:
        to_tensor = albu.Lambda(
            image=functools.partial(_to_tensor)
        )
    else:
        to_tensor = albu.Lambda(
            image=functools.partial(_to_tensor),
            mask=functools.partial(_to_tensor)
        )

    preprocess = [
        albu.Lambda(
            image=functools.partial(
                _normalize_image,
                mean=mean,
                std=std
            )
        ),
        to_tensor,
    ]
    return albu.Compose(preprocess)


问:
What happens when you access a DWORD at segment boundary in any OS that use segmentation memory management technique?
Considering we have an x86 processor and an OS that is using segmentation for memory management, for the sake of simplicity our segment boundary is 0xfff what happens when a process accesses a DWORD at boundary?

As x86 can access 32bit of data in one cycle will it just decode the instruction check if the specified address is in the boundary and give us a DWORD (from memory location 0xfff 0x1000 0x1001 0x1002 0x1003) or will it detect this memory violation?
I've tried this on an online 8086 emulator with a WORD and it doesn't seem to detect it.

Edit:
I am not asking about what will happen on an emulator, i am asking about what will happen on a 32bit physical processor.


问:
Dynamic Measure From Date Slicer Not working as expected
I have similar problem statement of (PowerBI/DAX: Unable to correctly compare two dates)

where I'm selected the start date and end date from slicer and wrote DAX for the measures as

Start_Date = CALCULATE(Min('Calendar'[Date]),ALLSELECTED('Calendar'))

End_Date = CALCULATE(Max('Calendar'[Date]),ALLSELECTED('Calendar'))

And I use them to compare with a column and return TRUE or FALSE.

IsTrue_Flag = IF(table[prod_date]>=[Start_Date] && table[prod_date] <= [End_Date], TRUE, FALSE)

But all my values are turning as TRUE which is not the case.

Where did I go wrong with the DAX? please help