问:
Selenium test case running locally but not on azure pipeline using chrome driver
My selenium testcases running locally in visual studio but when I check in the code on Azure build pipeline, its failing to locate the first element itself. Getting No such element exception.

Below is the CSProject nuget packages and dependencies I have added:

```<code>  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>

    <IsPackable>false</IsPackable>
      <PublishChromeDriver>True</PublishChromeDriver>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="DotNetSeleniumExtras.PageObjects" Version="3.11.0" />
    <PackageReference Include="DotNetSeleniumExtras.PageObjects.Core" Version="4.3.0" />
    <PackageReference Include="DotNetSeleniumExtras.WaitHelpers" Version="3.11.0" />
    <PackageReference Include="ExtentReports" Version="4.1.0" />
    <PackageReference Include="ExtentReports.Core" Version="1.0.3" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
    <PackageReference Include="Microsoft.Office.Interop.Excel" Version="15.0.4795.1001" />
    <PackageReference Include="NUnit" Version="3.13.3" />
    <PackageReference Include="NUnit.ConsoleRunner" Version="3.15.2" />
    <PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
    <PackageReference Include="Selenium.Support" Version="4.3.0" />
    <PackageReference Include="Selenium.WebDriver" Version="4.3.0" />
    <PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="108.0.5359.7100" />
    <PackageReference Include="Selenium.WebDriver.MSEdgeDriver" Version="107.0.1418.42" />
  </ItemGroup>
</code>```

ChromeDriver runs successfully with the below error snippet.

```<code><UnitTestResult executionId="00ad0f0d-8aea-41d7-8981-13961152aed9" testId="76a081c3-ed49-d739-5a18-7669ad294fce" testName="CreateSustainingProjectAndApproveGateDecision("Engineering Services")" computerName="compName" duration="00:00:20.4944700" startTime="2022-12-27T01:28:02.1595758-06:00" endTime="2022-12-27T01:28:22.6539741-06:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Failed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="00ad0f0d-8aea-41d7-8981-13961152aed9">
      <Output>
        <ErrorInfo>
          <Message>OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"xpath","selector":"//button[contains(@id,'create')]"}
  (Session info: chrome=108.0.5359.125)
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.</Message>
          <StackTrace>   at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)
   at OpenQA.Selenium.By.<.ctor>b__11_0(ISearchContext context)
   at OpenQA.Selenium.By.FindElement(ISearchContext context)
   `at OpenQA.Selenium.WebDriver.FindElement(By by)
   at PC.SeleniumUI.Tests.Start_Browser() in E:\AdosBuilds\ADOS-Agent1\1\s\UnitTests.cs:line 56
--TearDown
`

</code>```

If anyone has ever faced this issue on Azure server, can guide me?

I have tried the options like

waiting for a 25 seconds delay, adding await delay instaed of Thread.sleep

Adding the below options

```<code>var options = new ChromeOptions();
options.AddArguments("--headless"); //for headless mode
options.AddArguments("--window-size=800,600");//The invisible browser window is only 800x600 in size
options.AddArguments("start-maximized"); // open Browser in maximized mode
options.AddArguments("disable-infobars"); // disabling infobars
options.AddArguments("--disable-extensions"); // disabling extensions
options.AddArguments("--disable-gpu"); // applicable to windows os only
options.AddArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.AddArguments("--no-sandbox");
options.AddArguments("--disable-blink-features='BlockCredentialedSubresources'");
options.AddArguments("--whitelisted-ips='10.5.243.86'");
</code>```

Pass the authentication parameters

using CssSelector instead of Xpath

Body:
My selenium testcases running locally in visual studio but when I check in the code on Azure build pipeline, its failing to locate the first element itself. Getting No such element exception.

Below is the CSProject nuget packages and dependencies I have added:

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>

    <IsPackable>false</IsPackable>
      <PublishChromeDriver>True</PublishChromeDriver>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="DotNetSeleniumExtras.PageObjects" Version="3.11.0" />
    <PackageReference Include="DotNetSeleniumExtras.PageObjects.Core" Version="4.3.0" />
    <PackageReference Include="DotNetSeleniumExtras.WaitHelpers" Version="3.11.0" />
    <PackageReference Include="ExtentReports" Version="4.1.0" />
    <PackageReference Include="ExtentReports.Core" Version="1.0.3" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
    <PackageReference Include="Microsoft.Office.Interop.Excel" Version="15.0.4795.1001" />
    <PackageReference Include="NUnit" Version="3.13.3" />
    <PackageReference Include="NUnit.ConsoleRunner" Version="3.15.2" />
    <PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
    <PackageReference Include="Selenium.Support" Version="4.3.0" />
    <PackageReference Include="Selenium.WebDriver" Version="4.3.0" />
    <PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="108.0.5359.7100" />
    <PackageReference Include="Selenium.WebDriver.MSEdgeDriver" Version="107.0.1418.42" />
  </ItemGroup>

ChromeDriver runs successfully with the below error snippet.

<UnitTestResult executionId="00ad0f0d-8aea-41d7-8981-13961152aed9" testId="76a081c3-ed49-d739-5a18-7669ad294fce" testName="CreateSustainingProjectAndApproveGateDecision("Engineering Services")" computerName="compName" duration="00:00:20.4944700" startTime="2022-12-27T01:28:02.1595758-06:00" endTime="2022-12-27T01:28:22.6539741-06:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Failed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="00ad0f0d-8aea-41d7-8981-13961152aed9">
      <Output>
        <ErrorInfo>
          <Message>OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {"method":"xpath","selector":"//button[contains(@id,'create')]"}
  (Session info: chrome=108.0.5359.125)
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.</Message>
          <StackTrace>   at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.FindElement(String mechanism, String value)
   at OpenQA.Selenium.By.<.ctor>b__11_0(ISearchContext context)
   at OpenQA.Selenium.By.FindElement(ISearchContext context)
   `at OpenQA.Selenium.WebDriver.FindElement(By by)
   at PC.SeleniumUI.Tests.Start_Browser() in E:\AdosBuilds\ADOS-Agent1\1\s\UnitTests.cs:line 56
--TearDown
`

If anyone has ever faced this issue on Azure server, can guide me?

I have tried the options like

waiting for a 25 seconds delay, adding await delay instaed of Thread.sleep

Adding the below options

var options = new ChromeOptions();
options.AddArguments("--headless"); //for headless mode
options.AddArguments("--window-size=800,600");//The invisible browser window is only 800x600 in size
options.AddArguments("start-maximized"); // open Browser in maximized mode
options.AddArguments("disable-infobars"); // disabling infobars
options.AddArguments("--disable-extensions"); // disabling extensions
options.AddArguments("--disable-gpu"); // applicable to windows os only
options.AddArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.AddArguments("--no-sandbox");
options.AddArguments("--disable-blink-features='BlockCredentialedSubresources'");
options.AddArguments("--whitelisted-ips='10.5.243.86'");

Pass the authentication parameters

using CssSelector instead of Xpath


来源: stackexchange

问:
I need to implement the inApp video download feature same as Netflix,Hotstar,Amazone Prime in React native App?
A couple of months back, I came across a client requirement who wanted to build a feature to download and restrict video files in Android App, just like YouTube, Netflix, Amazon Prime does with us.
The steps need to be implemented is as follows :

Download the video from the URL

Encrypt the video file

Decrypt the video file at the time of playing

I use RNFetchBlob for download the video from the urls and RNFS is used for file access.
Requirement :
I need to encrypt the video file and decrypt the video file from the App.

If anyone knows the solution please help me......

I need to encrypt the video file and decrypt the video file from the App.

ContentLicense: CC BY-SA 4.0


问:
Securely using the deploy token in .gitlab-ci.yml
I have procured a deploy token with write access to our company's maven registry. I keep this token in .m2/settings.xml. mvn deploy from local dev boxes work fine:

```<code>$ mvn deploy
</code>```

I could keep the token in custom-settings.xml as part of the source code repo and in .gitlab-ci.yml I could invoke mvn deploy like so:

```<code>mvn --settings custom-settings.xml deploy
</code>```

Apparently this will expose the deploy token which I'm trying to avoid. How do I pass the token securely to the mvn deploy step in .gitbal-ci.yml?

Body:
I have procured a deploy token with write access to our company's maven registry. I keep this token in .m2/settings.xml. mvn deploy from local dev boxes work fine:

$ mvn deploy

I could keep the token in custom-settings.xml as part of the source code repo and in .gitlab-ci.yml I could invoke mvn deploy like so:

mvn --settings custom-settings.xml deploy

Apparently this will expose the deploy token which I'm trying to avoid. How do I pass the token securely to the mvn deploy step in .gitbal-ci.yml?


问:
How to declare and use map var in yaml file?
I try to write a map in y yaml file and want to use it in yaml file itself with a key. for example ->
in my yaml file I wrote -

```<code>pod_env_map:
  pod1: "env1"
  pod2: "env2"
  pod3: "env3"
</code>```

and in this yaml file itself I'm getting a var $pod_name.
So now i want to write stages with some command for all pod and correspond env.
So instead of putting multiple checks of $pod_name == 'pod1'....
I want to use above dict somehow in code like pod_env_map[$pod_name], please help me to know what should be the syntax for this? I tried to find but didn't get relavent info anywhere.

Body:
I try to write a map in y yaml file and want to use it in yaml file itself with a key. for example ->
in my yaml file I wrote -

pod_env_map:
  pod1: "env1"
  pod2: "env2"
  pod3: "env3"

and in this yaml file itself I'm getting a var $pod_name.
So now i want to write stages with some command for all pod and correspond env.
So instead of putting multiple checks of $pod_name == 'pod1'....
I want to use above dict somehow in code like pod_env_map[$pod_name], please help me to know what should be the syntax for this? I tried to find but didn't get relavent info anywhere.


问:
Antd Table Column is breaking column title

Reproduction link

Steps to reproduce

Open the codesandbox link.

Reduce the preview window width.

You can see, instead of horizontal scrolling it's just breaking the column header and taking the the same width of a value cell.

What is expected?

First it should set the column width to the column header cell width then if the any column value cell width is longer than header cell width it fall back to cell value width.

What is actually happening?

When table header is sticky, scroll={{  x: 'max-content' }} and there is no width property specified in each column definition then unless column cell value width is bigger than column header title, column title is breaking(Simply, Column width is equal to max cell width without respecting the column header width).

Environment
Info

antd
4.24.1

React
17.0.2

System
MacOS

Browser
Chrome 108

This situation is happening because of 'sticky'.
My row data & column definition is from remote API call and i want horizontal scrolling instead of 'Ellipsis' & don't wanna set hardcoded width to each column, fixed scrollX.


问:
im working on an flutter app chatbox using firebase i got _CastError (Null check operator used on a null value) error when its loaded
```<code>  class _AuthFormScreenState extends State<AuthFormScreen> {
  final _formKey = GlobalKey<FormState>();

var _isLogin = true;

var _userEmail = '';

var _userName = '';

 var _userPassword = '';

File? _userImage;

void _pickedImage(File image) {

_userImage = image;
}

if (isValid) {
  _formKey.currentState?.save();
  widget.submitFn(_userEmail.trim(), _userName.trim(), _userImage!,`Got the exception here`
      _userPassword.trim(), _isLogin);
  }
}
</code>```

im working on an flutter app chatbox using firebase i got _CastError (Null check operator used on a null value) error when its loaded

Body:
  class _AuthFormScreenState extends State<AuthFormScreen> {
  final _formKey = GlobalKey<FormState>();

var _isLogin = true;

var _userEmail = '';

var _userName = '';

 var _userPassword = '';

File? _userImage;

void _pickedImage(File image) {

_userImage = image;
}

if (isValid) {
  _formKey.currentState?.save();
  widget.submitFn(_userEmail.trim(), _userName.trim(), _userImage!,`Got the exception here`
      _userPassword.trim(), _isLogin);
  }
}

im working on an flutter app chatbox using firebase i got _CastError (Null check operator used on a null value) error when its loaded


问:
django.db.utils.InterfaceError: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0)
```<code>DATABASES = {
    'default': {
        # 'ENGINE': 'sql_server.pyodbc',
        'ENGINE': 'mssql',
        'NAME': 'DatabaseName',
        'HOST': 'ServerName',
        'USER': 'LoginId',
        'PASSWORD': 'LoginPass'
        # 'OPTIONS': {
        #   'DRIVER': 'SQL Server Native Client 11.0'
        # # 'DRIVER': 'ODBC Driver 13 for SQL Server',
        # }  #, 'Extra_Params':'Trusted_Connection=True'}
    }
}
</code>```

I already have SQL Server 11.0 installed, also ODBC 13 Driver installed
Also configured System DSN as well.
Please suggest.

Body:
DATABASES = {
    'default': {
        # 'ENGINE': 'sql_server.pyodbc',
        'ENGINE': 'mssql',
        'NAME': 'DatabaseName',
        'HOST': 'ServerName',
        'USER': 'LoginId',
        'PASSWORD': 'LoginPass'
        # 'OPTIONS': {
        #   'DRIVER': 'SQL Server Native Client 11.0'
        # # 'DRIVER': 'ODBC Driver 13 for SQL Server',
        # }  #, 'Extra_Params':'Trusted_Connection=True'}
    }
}

I already have SQL Server 11.0 installed, also ODBC 13 Driver installed
Also configured System DSN as well.
Please suggest.


问:
I have a CI 3 project with PHP v5.6 I need to upgrade my PHP from v5.6 to v7.3 Suggest steps for that and Do i have to update the library files also?
I have a CI 3 project with PHP v5.6 I need to upgrade my PHP from v5.6 to v7.3

->Suggest steps to follow for PHP upgradation
->Do I have to update the library files also? These are 3rd party libraries like s3, aws-sdk-for-php, etc.

I have the list of deprecated and incompatible changes that need to be changed, But I am not sure if I have to find a replacement for the library files as well.


问:
How to only calculate VAT over profits with Quaderno + Woocommerce
I use Quaderno to calculate the VAT over the digital products I sell in my webshop.
However since a short while I have two types of products, one that I buy and sell myself which requires the full VAT to be calculated over the full price.

The second are a marketplace type products, where I pay out 80% to the seller, and keep 20% myself as profit. I use a Woocommerce panel for this (WCFM).

However for the second product, the VAT is  still being calculated over the full price. This results in me paying more VAT than I actually earn on the Commission (since I only earn 20%). In this case I only have to pay VAT over the 20% that I take as commission, but I don't know how to configure this.

I assume a specific calculator code would work here but I'm stumped. Hope anyone has some advice!


问:
An error occurs when uploading additional galleries in MAUI(C#)
When uploading images in the gallery, the first time is normal, but an error occurs when additional images are uploaded.

Could you please confirm what could be the problem?

Error string :

System.ObjectDisposedException: 'Cannot access a closed Stream.'

The source below is my source uploaded on Github.

My source in Github

This is My Viewmodel variable.

```<code>private IEnumerable<PickImages> selectedItems;
    public IEnumerable<PickImages> SelectedItems
    {
        get
        {
            return selectedItems;
        }
        set
        {
            SetProperty(ref selectedItems, value);
        }
    }
</code>```

And This is My Model Class

```<code>public class PickImages
{
    public ImageSource CombineDeleteMarkImage { get; set; }

    public string MainImageYN { get; set; }
}
</code>```

And I set My variable(selectedItems) Like this in viewModel

```<code>void Pick(View view, params MediaFileType[] types)
    {
        try
        {
            Task.Run(async () =>
            {
                CancellationTokenSource cts = null;

                try
                {
                    //DisposeItems();

                    cts = new CancellationTokenSource(
                        TimeSpan.FromMilliseconds(5000000));

                    var result = await MediaGallery.PickAsync(
                        new MediaPickRequest(SelectionLimit, types)
                        {
                            Title = $"Select {SelectionLimit} photos",
                            PresentationSourceBounds = view?.GetAbsoluteBounds(40),
                            UseCreateChooser = UseCreateChooser
                        },
                        cts.Token);

                    List<Image> liImageSource= new List<Image>();

                    List<PickImages> list = new List<PickImages>();
                    if (SelectedItems != null)
                        list = SelectedItems.ToList();

                    foreach (var item in await SetImage(result))
                    {

                        if (list.Count > 10)
                        {
                            return;
                        }

                        Image image = ImageHelper.ImageThumnailMaker(item);

                        bool blcheckMainimg = false;
                        foreach (var s_item in list)
                        {
                            if (s_item.MainImageYN.Equals("Y"))
                            {
                                blcheckMainimg = true;
                                break;
                            }
                        }

                        if (blcheckMainimg)
                        {
                            list.Add(new PickImages { CombineDeleteMarkImage = image.Source, MainImageYN = "N" });
                        }
                        else
                        {

                            //Image mImage = ImageHelper.CombineWithMain(item);
                            list.Add(new PickImages { CombineDeleteMarkImage = image.Source, MainImageYN = "Y" });
                        }

                    }

                    SelectedItems = list;

                }
                catch (Exception ex)
                {
                    OperationInfo = ex.Message;
                }
                finally
                {
                    cts?.Dispose();

                }
            });
        }
        catch (Exception)
        {

            throw;
        }

    }
</code>```

When registering an image for the first time, it is normal, but when registering an additional image from the original gallery image, a Stream Error occurs.

And this is my xaml.

```<code><BindableLayout.ItemTemplate>
                                <DataTemplate>
                                    <ContentView Padding="0,8">
                                        <Grid>
                                            <AbsoluteLayout>
                                                <Image Source="{Binding SelectedItems.CombineDeleteMarkImage}"
                                                        WidthRequest="80"
                                                        HeightRequest="80"
                                                        VerticalOptions="Center"
                                                        HorizontalOptions="Center" />

                                                <myc:MyBoxView
                                                        AbsoluteLayout.LayoutBounds="1,0,0.3,0.3"
                                                        AbsoluteLayout.LayoutFlags="All">
                                                    <BoxView.GestureRecognizers>
                                                        <TapGestureRecognizer
                                                            Command="{Binding BoxViewTapCommand}"
                                                            />
                                                    </BoxView.GestureRecognizers>
                                                </myc:MyBoxView>
                                            </AbsoluteLayout>
                                        </Grid>
                                        <ContentView.GestureRecognizers>
                                            <TapGestureRecognizer
                                                Command="{Binding ImageTapGestureCommand}"/>
                                        </ContentView.GestureRecognizers>
                                    </ContentView>
                                </DataTemplate>
                            </BindableLayout.ItemTemplate>
                        </StackLayout>
</code>```

What am i missing?

Body:
When uploading images in the gallery, the first time is normal, but an error occurs when additional images are uploaded.

Could you please confirm what could be the problem?

Error string :

System.ObjectDisposedException: 'Cannot access a closed Stream.'

The source below is my source uploaded on Github.

My source in Github

This is My Viewmodel variable.

private IEnumerable<PickImages> selectedItems;
    public IEnumerable<PickImages> SelectedItems
    {
        get
        {
            return selectedItems;
        }
        set
        {
            SetProperty(ref selectedItems, value);
        }
    }

And This is My Model Class

public class PickImages
{
    public ImageSource CombineDeleteMarkImage { get; set; }

    public string MainImageYN { get; set; }
}

And I set My variable(selectedItems) Like this in viewModel

void Pick(View view, params MediaFileType[] types)
    {
        try
        {
            Task.Run(async () =>
            {
                CancellationTokenSource cts = null;

                try
                {
                    //DisposeItems();

                    cts = new CancellationTokenSource(
                        TimeSpan.FromMilliseconds(5000000));

                    var result = await MediaGallery.PickAsync(
                        new MediaPickRequest(SelectionLimit, types)
                        {
                            Title = $"Select {SelectionLimit} photos",
                            PresentationSourceBounds = view?.GetAbsoluteBounds(40),
                            UseCreateChooser = UseCreateChooser
                        },
                        cts.Token);

                    List<Image> liImageSource= new List<Image>();

                    List<PickImages> list = new List<PickImages>();
                    if (SelectedItems != null)
                        list = SelectedItems.ToList();

                    foreach (var item in await SetImage(result))
                    {

                        if (list.Count > 10)
                        {
                            return;
                        }

                        Image image = ImageHelper.ImageThumnailMaker(item);

                        bool blcheckMainimg = false;
                        foreach (var s_item in list)
                        {
                            if (s_item.MainImageYN.Equals("Y"))
                            {
                                blcheckMainimg = true;
                                break;
                            }
                        }

                        if (blcheckMainimg)
                        {
                            list.Add(new PickImages { CombineDeleteMarkImage = image.Source, MainImageYN = "N" });
                        }
                        else
                        {

                            //Image mImage = ImageHelper.CombineWithMain(item);
                            list.Add(new PickImages { CombineDeleteMarkImage = image.Source, MainImageYN = "Y" });
                        }

                    }

                    SelectedItems = list;

                }
                catch (Exception ex)
                {
                    OperationInfo = ex.Message;
                }
                finally
                {
                    cts?.Dispose();

                }
            });
        }
        catch (Exception)
        {

            throw;
        }

    }

When registering an image for the first time, it is normal, but when registering an additional image from the original gallery image, a Stream Error occurs.

And this is my xaml.

<BindableLayout.ItemTemplate>
                                <DataTemplate>
                                    <ContentView Padding="0,8">
                                        <Grid>
                                            <AbsoluteLayout>
                                                <Image Source="{Binding SelectedItems.CombineDeleteMarkImage}"
                                                        WidthRequest="80"
                                                        HeightRequest="80"
                                                        VerticalOptions="Center"
                                                        HorizontalOptions="Center" />

                                                <myc:MyBoxView
                                                        AbsoluteLayout.LayoutBounds="1,0,0.3,0.3"
                                                        AbsoluteLayout.LayoutFlags="All">
                                                    <BoxView.GestureRecognizers>
                                                        <TapGestureRecognizer
                                                            Command="{Binding BoxViewTapCommand}"
                                                            />
                                                    </BoxView.GestureRecognizers>
                                                </myc:MyBoxView>
                                            </AbsoluteLayout>
                                        </Grid>
                                        <ContentView.GestureRecognizers>
                                            <TapGestureRecognizer
                                                Command="{Binding ImageTapGestureCommand}"/>
                                        </ContentView.GestureRecognizers>
                                    </ContentView>
                                </DataTemplate>
                            </BindableLayout.ItemTemplate>
                        </StackLayout>

What am i missing?


问:
How do I append JSON entries to CSV file under columns with the same names as the keys?
This is my code :

```<code>import pandas as pd
import requests

response = requests.get(f'https://www.magicbricks.com/mbsrp/propertySearch.html?editSearch=Y&category=S&propertyType=10002,10003,10021,10022,10001,10017,10000&bedrooms=11700,11701,11702,11703,11704,11705,11706,11707,11708,11709,11710&city=4320&page=2&groupstart=30&offset=0&maxOffset=248&sortBy=premiumRecent&postedSince=-1&pType=10002,10003,10021,10022,10001,10017,10000&isNRI=N&multiLang=en')
df = pd.json_normalize(response.json()['resultList'], max_level=0)
df.to_csv('property_data.csv', mode='a')

for i in range(3, 102):
    response = requests.get(f'https://www.magicbricks.com/mbsrp/propertySearch.html?editSearch=Y&category=S&propertyType=10002,10003,10021,10022,10001,10017,10000&bedrooms=11700,11701,11702,11703,11704,11705,11706,11707,11708,11709,11710&city=4320&page={i}&groupstart={30 * (i - 1)}&offset=0&maxOffset=248&sortBy=premiumRecent&postedSince=-1&pType=10002,10003,10021,10022,10001,10017,10000&isNRI=N&multiLang=en')
    df = pd.json_normalize(response.json()['resultList'])
    df.to_csv('property_data.csv', mode='a', header=False)
</code>```

An issue I am encountering while appending to the property_data.csv file is that due to the non existence certain keys in JSON file, data from different columns is getting mixed up.

eg:

```<code>df = pd.read_csv("property_data.csv", on_bad_lines='skip')
df['floorNo'].unique()
</code>```

produces the result

```<code>Output exceeds the size limit. Open the full output data in a text editor
array([nan, '9', '38', '12', '10', '17', '16', '48', '28', '3', '15',
       '35', '5', '30', '21', '27', '45', '11', 'Lift', 'Air Conditioned',
       'Private jaccuzi', 'Jogging and Strolling Track', 'North - East',
       'South -West', 'East', 'West', 'South', 'North', 'South - East',
       'ABAMNC', 'MCGM', 'Water Availability 24 Hours Available',
       'Water Availability 6 Hours Available',
       'Water Availability 12 Hours Available',
       'Water Availability 1 Hour Available', '800', '355', '550', '507',
       '250', '750', '1310', '1620', '1295', '650', '1012', '600', '2000',
       '555', '775', '920', '1095', '882', '1500', '630', '1100', '699',
       '900', '540', 'Intercom Facility', '71353', '68345', '77877',
       '56356', '54016', '68703', '64595',
       'ff260c41-dd5c-44a1-866f-c9cedca191e8graj6227',
       '96de2716-6a3a-488f-a34c-f01563544696ghar1657',
       '5d6b1f8e-73a4-4439-a956-c4c8367e8bd7raje3800',
       '9f75a3cd-f749-42aa-bc77-39ef9d2ad8c7yoge1410',
       '0955f6a3-f09e-417b-a2e1-8332b6d467f0vaid3337',
       'b2ce8fad-2392-4b26-95d9-edaf4bf46cddkhuz5152',
       '6e729b73-e20b-4b43-832d-30cef3094fc4chan8207',
       'b09c339d-5667-4095-a756-b54356a44ddckash6262',
       '50abb073-dfdd-4e24-b544-712b6d8bcc43bina7067',
       '58d5ac1c-cdb3-4542-96c3-581b3a9fb8d1meha4330',
       '35d87e1a-5dfd-4c8f-9192-0acbb8d36d60hari1100',
       '53d875a6-1074-443e-b7d7-a1cb55f63d6anila1380',
       '3cad0738-bdf0-4f1b-81f3-4bb890a16e77scsh5048', '+91-81XXXXXXX88',
...
       'prathamesh apartments, Matunga East, Mumbai', 'Bhandup',
       '40 X 100 sqft sqft', 'Freehold', 'Co-operative Society',
       'Power Back Up', 'Near Sitladevi Temple, Kotak Mahindra Bank',
       'Near Lodha World School', 'Newly Constructed Property',
       'Near Mohan Baug Banquet hall', 'Smart Home'], dtype=object)
</code>```

How do I make it so that the data is appended to the correct column on the csv file and if the file does not have a certain column, we create a new one and set values of other entries to null?

Body:
This is my code :

import pandas as pd
import requests

response = requests.get(f'https://www.magicbricks.com/mbsrp/propertySearch.html?editSearch=Y&category=S&propertyType=10002,10003,10021,10022,10001,10017,10000&bedrooms=11700,11701,11702,11703,11704,11705,11706,11707,11708,11709,11710&city=4320&page=2&groupstart=30&offset=0&maxOffset=248&sortBy=premiumRecent&postedSince=-1&pType=10002,10003,10021,10022,10001,10017,10000&isNRI=N&multiLang=en')
df = pd.json_normalize(response.json()['resultList'], max_level=0)
df.to_csv('property_data.csv', mode='a')

for i in range(3, 102):
    response = requests.get(f'https://www.magicbricks.com/mbsrp/propertySearch.html?editSearch=Y&category=S&propertyType=10002,10003,10021,10022,10001,10017,10000&bedrooms=11700,11701,11702,11703,11704,11705,11706,11707,11708,11709,11710&city=4320&page={i}&groupstart={30 * (i - 1)}&offset=0&maxOffset=248&sortBy=premiumRecent&postedSince=-1&pType=10002,10003,10021,10022,10001,10017,10000&isNRI=N&multiLang=en')
    df = pd.json_normalize(response.json()['resultList'])
    df.to_csv('property_data.csv', mode='a', header=False)

An issue I am encountering while appending to the property_data.csv file is that due to the non existence certain keys in JSON file, data from different columns is getting mixed up.

eg:

df = pd.read_csv("property_data.csv", on_bad_lines='skip')
df['floorNo'].unique()

produces the result

Output exceeds the size limit. Open the full output data in a text editor
array([nan, '9', '38', '12', '10', '17', '16', '48', '28', '3', '15',
       '35', '5', '30', '21', '27', '45', '11', 'Lift', 'Air Conditioned',
       'Private jaccuzi', 'Jogging and Strolling Track', 'North - East',
       'South -West', 'East', 'West', 'South', 'North', 'South - East',
       'ABAMNC', 'MCGM', 'Water Availability 24 Hours Available',
       'Water Availability 6 Hours Available',
       'Water Availability 12 Hours Available',
       'Water Availability 1 Hour Available', '800', '355', '550', '507',
       '250', '750', '1310', '1620', '1295', '650', '1012', '600', '2000',
       '555', '775', '920', '1095', '882', '1500', '630', '1100', '699',
       '900', '540', 'Intercom Facility', '71353', '68345', '77877',
       '56356', '54016', '68703', '64595',
       'ff260c41-dd5c-44a1-866f-c9cedca191e8graj6227',
       '96de2716-6a3a-488f-a34c-f01563544696ghar1657',
       '5d6b1f8e-73a4-4439-a956-c4c8367e8bd7raje3800',
       '9f75a3cd-f749-42aa-bc77-39ef9d2ad8c7yoge1410',
       '0955f6a3-f09e-417b-a2e1-8332b6d467f0vaid3337',
       'b2ce8fad-2392-4b26-95d9-edaf4bf46cddkhuz5152',
       '6e729b73-e20b-4b43-832d-30cef3094fc4chan8207',
       'b09c339d-5667-4095-a756-b54356a44ddckash6262',
       '50abb073-dfdd-4e24-b544-712b6d8bcc43bina7067',
       '58d5ac1c-cdb3-4542-96c3-581b3a9fb8d1meha4330',
       '35d87e1a-5dfd-4c8f-9192-0acbb8d36d60hari1100',
       '53d875a6-1074-443e-b7d7-a1cb55f63d6anila1380',
       '3cad0738-bdf0-4f1b-81f3-4bb890a16e77scsh5048', '+91-81XXXXXXX88',
...
       'prathamesh apartments, Matunga East, Mumbai', 'Bhandup',
       '40 X 100 sqft sqft', 'Freehold', 'Co-operative Society',
       'Power Back Up', 'Near Sitladevi Temple, Kotak Mahindra Bank',
       'Near Lodha World School', 'Newly Constructed Property',
       'Near Mohan Baug Banquet hall', 'Smart Home'], dtype=object)

How do I make it so that the data is appended to the correct column on the csv file and if the file does not have a certain column, we create a new one and set values of other entries to null?


问:
VScode cannot modify the settings and in the settings.json show "End of file expected" error
That day,i wanna modify my font size in the VScode.But it pops out Failed to write user settings. Please turn it on to correct any errors / warnings and try again..Then i turn to the settings.json while i click the button open the settings.There is parenthese[8,1](the third one) showing an error calledEnd of file expected.jsonc.Following is my settings,json.

```<code>{
"workbench.colorTheme": "One Dark Pro",
"code-runner.runInTerminal": true,
"files.autoSave": "afterDelay",
"terminal.integrated.enableMultiLinePasteWarning": false,
"editor.unicodeHighlight.invisibleCharacters": false,
"python.linting.flake8Enabled": true,
"python.formatting.provider": "yapf",
"python.linting.flake8Args": ["--max-line-length=248"],
"python.linting.pylintEnabled": false
</code>```

}

i tried to delete the second[7,1] and the third[8,1] parentheses } and { to combine these,but not works.
i also attempt to add a comma or a semicolon , or ; between the second parenthese and the third one. but also in vain.

Body:
That day,i wanna modify my font size in the VScode.But it pops out Failed to write user settings. Please turn it on to correct any errors / warnings and try again..Then i turn to the settings.json while i click the button open the settings.There is parenthese[8,1](the third one) showing an error calledEnd of file expected.jsonc.Following is my settings,json.

{
"workbench.colorTheme": "One Dark Pro",
"code-runner.runInTerminal": true,
"files.autoSave": "afterDelay",
"terminal.integrated.enableMultiLinePasteWarning": false,
"editor.unicodeHighlight.invisibleCharacters": false,
"python.linting.flake8Enabled": true,
"python.formatting.provider": "yapf",
"python.linting.flake8Args": ["--max-line-length=248"],
"python.linting.pylintEnabled": false

}

i tried to delete the second[7,1] and the third[8,1] parentheses } and { to combine these,but not works.
i also attempt to add a comma or a semicolon , or ; between the second parenthese and the third one. but also in vain.


问:
lottie-player is not working in bootstrap 5 application
When i try to use lottie-player it is showing the below error

Uncaught (in promise) TypeError: Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is not of type 'Element'.

line this._io.observe(this.container)), this.container - is null

```<code><div id="animation-container" class$lit$="lit$880547042$" lang="en" aria-label$lit$="lit$880547042$" role="img"> <div id="animation" class$lit$="lit$880547042$" style$lit$="background:lit$880547042$;"> <!--?lit$880547042$-->main </div> <!--?lit$880547042$-->Lottie animation </div>
</code>```

Note:  class name was changed class$lit$

```<code>var a = '<lottie-player src="'+imgJson+'" background="transparent"  speed="1"  style="width: 100%; height: 100%;" loop autoplay></lottie-player>'
 $('.empto').append(a);
</code>```

imgJson - dynamically path will be appended

Body:
When i try to use lottie-player it is showing the below error

Uncaught (in promise) TypeError: Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is not of type 'Element'.

line this._io.observe(this.container)), this.container - is null

 main
 Lottie animation

Note:  class name was changed class$lit$

var a = '<lottie-player src="'+imgJson+'" background="transparent"  speed="1"  style="width: 100%; height: 100%;" loop autoplay></lottie-player>'
 $('.empto').append(a);

imgJson - dynamically path will be appended


问:
unable to synchronise (copy) content from Staging to Production in Prismic
We are ready to go live as the production environment is ready now!  But I struggle to find the “synchronise” button in our Prod > setting so that we can copy our content from Staging over to Prod. There’s an export / import button instead.

How can I find the synchronisation function?
What’s the difference between import/export and the synchronisation function in Prismic please?

Thanks so much!

PJC

Hi! I hope I don’t offend anyone as I’m not a developer. im grateful for any help received as I can’t find anything in Prismic website.  I hope to stumble upon a Prismic staff here who can help!

In Prismic, I’ve used the “synchronise” function to copy content from the Dev environment to Staging.

We are due to go live for my clients website. But I struggle to find the said “synchronise” button in our Prod > setting so that we can copy our content from Staging over to Prod. There’s an export / import button instead.

How can I find the synchronisation function?
What’s the difference between import/export and the synchronisation function in Prismic please?

Thanks so much!

Best,
PJC


问:
Im inserting file in container in cosmos db using powershell but there is error Invoke-WebRequest :The remote server returned an error:404 Not Found
I am running the powershell script to add file in container but there is error "The remote server returned an error: (404) Not Found."</p>
```<code>$resourceGroupName = "DBRG1"
$AccountName = "firstdb"
$databaseName = "testdb1"
$cosmosDbContext = New-CosmosDbContext -Account $AccountName -Database $databaseName -ResourceGroup $resourceGroupName
$document = @"
{
    "id": "6fa9b3d5-ce1a-4b38-9068-9d17de5b1c69",
    "createTime": "2018-05-21T22:59:59.999Z",
    "RuleType": "FTOD"
}
"@
$partitionkey = "FTOD"
New-CosmosDbDocument -Context $cosmosDbContext -CollectionId 'part' -DocumentBody $document -PartitionKey $partitionkey

</code>```

Body:
I am running the powershell script to add file in container but there is error "The remote server returned an error: (404) Not Found."

$resourceGroupName = "DBRG1"
$AccountName = "firstdb"
$databaseName = "testdb1"
$cosmosDbContext = New-CosmosDbContext -Account $AccountName -Database $databaseName -ResourceGroup $resourceGroupName
$document = @"
{
    "id": "6fa9b3d5-ce1a-4b38-9068-9d17de5b1c69",
    "createTime": "2018-05-21T22:59:59.999Z",
    "RuleType": "FTOD"
}
"@
$partitionkey = "FTOD"
New-CosmosDbDocument -Context $cosmosDbContext -CollectionId 'part' -DocumentBody $document -PartitionKey $partitionkey


问:
Error: Uncaught [TypeError: createKeccakHash is not a function]
I am trying to use web3js external calls in jest test. Previously i was able to get data, but the error thrown was can not console response after the end of test  something like this, although i was able to see the response but in catch block.

But now it is not letting me make any external call.
HELP

```<code>    describe("Deployment", function () {
    it("Should set the right unlockTime", async () => {
        try {
            const { result, rerender } = renderHook(() => {return useAccounts()}, { wrapper: MockApp });
            console.log("result BB", result);
            console.log(await result?.current);
            console.log("result A"  , result);
            rerender();

            await waitFor(async () => {
                console.log("hiiiiiiiiiii");
                console.log(await result?.current.bal())
                console.log("bye");
            })

            // const response = await result.current.bal();
            console.log("hiiiiiiiiiii");
            console.log("res-----", result.current);
        } catch (error) {
            console.log(error);
        }
    });
});
</code>```

[Source file of test] (https://i.stack.imgur.com/QfIVY.png)

[error] (https://i.stack.imgur.com/Uxj8R.png)

[broken point] (https://i.stack.imgur.com/odVeR.png)

Body:
I am trying to use web3js external calls in jest test. Previously i was able to get data, but the error thrown was can not console response after the end of test  something like this, although i was able to see the response but in catch block.

But now it is not letting me make any external call.
HELP

    describe("Deployment", function () {
    it("Should set the right unlockTime", async () => {
        try {
            const { result, rerender } = renderHook(() => {return useAccounts()}, { wrapper: MockApp });
            console.log("result BB", result);
            console.log(await result?.current);
            console.log("result A"  , result);
            rerender();

            await waitFor(async () => {
                console.log("hiiiiiiiiiii");
                console.log(await result?.current.bal())
                console.log("bye");
            })

            // const response = await result.current.bal();
            console.log("hiiiiiiiiiii");
            console.log("res-----", result.current);
        } catch (error) {
            console.log(error);
        }
    });
});

[Source file of test] (https://i.stack.imgur.com/QfIVY.png)

[error] (https://i.stack.imgur.com/Uxj8R.png)

[broken point] (https://i.stack.imgur.com/odVeR.png)


问:
UserError: application/json is not an accepted when running Sagemaker PipelineModel batch transform
I built a Sagemaker PipelineModel that consists of a SKLearn estimator and a XGB model. The lines of code used to built the PipelineModel object are as follows:

```<code># tuner is a fitted HyperparameterTuner
# image_uri: the xgb image
mod = tuner.best_estimator()
xgb = Model(
    image_uri=image_uri,
    model_data=mod.model_data,
    role=role,
)

from sagemaker.model import Model
from sagemaker.pipeline import PipelineModel
import boto3
from time import gmtime, strftime

timestamp_prefix = strftime("%Y-%m-%d-%H-%M-%S", gmtime())

scikit_learn_inferencee_model = sklearn_preprocessor.create_model()
# xgb_model = mod.create_model()

model_name = "Inference-pipeline-" + timestamp_prefix
sm_model = PipelineModel(
    name=model_name, role=role, models=[scikit_learn_inferencee_model, xgb]
)

final = sm_model.transformer(instance_count=1, instance_type="ml.m5.2xlarge", assemble_with="Line", accept="text/csv",strategy='SingleRecord',)
final.transform(batch_data,
                      split_type='Line',
                      content_type="text/csv",
                      input_filter="$[1:]",
                      join_source="Input",
                      output_filter="$[0,-2, -1]",
                      wait=False,
                      # logs=True
                     )

</code>```

When running the transform job I encountered an error sagemaker_algorithm_toolkit.exceptions.UserError: application/json is not an accepted ContentType: csv, libsvm, parquet, recordio-protobuf, text/csv, text/libsvm, text/x-libsvm, application/x-parquet, application/x-recordio-protobuf. The error occurred in the second container, which is the xgboost model, as logs on CloudWatch said everything worked just fine in the first container.

Did this error happened because the intermediate response passed from the first container(sklearn estimator) to the second container(xgb) was in application/json format? What can I do to fix this?

Body:
I built a Sagemaker PipelineModel that consists of a SKLearn estimator and a XGB model. The lines of code used to built the PipelineModel object are as follows:

# tuner is a fitted HyperparameterTuner
# image_uri: the xgb image
mod = tuner.best_estimator()
xgb = Model(
    image_uri=image_uri,
    model_data=mod.model_data,
    role=role,
)

from sagemaker.model import Model
from sagemaker.pipeline import PipelineModel
import boto3
from time import gmtime, strftime

timestamp_prefix = strftime("%Y-%m-%d-%H-%M-%S", gmtime())

scikit_learn_inferencee_model = sklearn_preprocessor.create_model()
# xgb_model = mod.create_model()

model_name = "Inference-pipeline-" + timestamp_prefix
sm_model = PipelineModel(
    name=model_name, role=role, models=[scikit_learn_inferencee_model, xgb]
)

final = sm_model.transformer(instance_count=1, instance_type="ml.m5.2xlarge", assemble_with="Line", accept="text/csv",strategy='SingleRecord',)
final.transform(batch_data,
                      split_type='Line',
                      content_type="text/csv",
                      input_filter="$[1:]",
                      join_source="Input",
                      output_filter="$[0,-2, -1]",
                      wait=False,
                      # logs=True
                     )

When running the transform job I encountered an error sagemaker_algorithm_toolkit.exceptions.UserError: application/json is not an accepted ContentType: csv, libsvm, parquet, recordio-protobuf, text/csv, text/libsvm, text/x-libsvm, application/x-parquet, application/x-recordio-protobuf. The error occurred in the second container, which is the xgboost model, as logs on CloudWatch said everything worked just fine in the first container.

Did this error happened because the intermediate response passed from the first container(sklearn estimator) to the second container(xgb) was in application/json format? What can I do to fix this?


问:
Serilog is made as a logging plugin and no log files are generated in the project directory after deploying and running the windows service
My project is c#6.0, after deploying it as a windows service, after the project runs, the log file is not generated in the directory, but in the C:\Windows\System32 folder

```<code>"Serilog": {
    "Using": [
      "Serilog.Sinks.File",
      "Serilog.Sinks.Console",
      "Serilog.Settings.Configuration",
      "Serilog.Expressions"
    ],
    "MinimumLevel": {
      "Default": "Verbose",
      "Override": {
        "Microsoft": "Warning",
        "System": "Warning",
        "Microsoft.AspNetCore": "Error",
        "Microsoft.AspNetCore.Cors.Infrastructure.CorsService": "Error",
        "Microsoft.AspNetCore.Mvc": "Error",
        "Microsoft.AspNetCore.Hosting": "Error",
        "Microsoft.Hosting.Lifetime": "Information"
      }
    },
    "WriteTo": [
      {
        "Name": "Console",
        "Args": {
          "outputTemplate": "【时间】{Timestamp:yyyy-MM-dd HH:mm:ss,fff}{NewLine}【等级】{Level}{NewLine}【消息】[{SourceContext}]{Message:lj}{NewLine}{Exception}{NewLine}"
        }
      },
      {
        "Name": "Logger",
        "Args": {
          "configureLogger": {
            "Filter": [
              {
                "Name": "ByIncludingOnly",
                "Args": {
                  "expression": "@l = 'Debug'"
                }
              }
            ],
            "WriteTo": [
              {
                "Name": "File",
                "Args": {
                  "path": "logs/Debug/.log",
                  "rollingInterval": "Day",
                  "retainedFileTimeLimit": "7.00:00:00",
                  "outputTemplate": "【时间】{Timestamp:yyyy-MM-dd HH:mm:ss,fff}{NewLine}【等级】[{Level}]{NewLine}【消息】[{SourceContext}] {Message:lj}{NewLine}{Exception}{NewLine}"
                }
              }
            ]
          }
        }
      },
      {
        "Name": "Logger",
        "Args": {
          "configureLogger": {
            "Filter": [
              {
                "Name": "ByIncludingOnly",
                "Args": {
                  "expression": "@l = 'Information'"
                }
              }
            ],
            "WriteTo": [
              {
                "Name": "File",
                "Args": {
                  "path": "logs/Information/.log",
                  "rollingInterval": "Day",
                  "retainedFileTimeLimit": "7.00:00:00",
                  "outputTemplate": "【时间】{Timestamp:yyyy-MM-dd HH:mm:ss,fff}{NewLine}【等级】[{Level}]{NewLine}【消息】[{SourceContext}] {Message:lj}{NewLine}{Exception}{NewLine}"
                }
              }
            ]
          }
        }
      },
      {
        "Name": "Logger",
        "Args": {
          "configureLogger": {
            "Filter": [
              {
                "Name": "ByIncludingOnly",
                "Args": {
                  "expression": "@l = 'Warning'"
                }
              }
            ],
            "WriteTo": [
              {
                "Name": "File",
                "Args": {
                  "path": "logs/Warning/.log",
                  "rollingInterval": "Day",
                  "retainedFileTimeLimit": "7.00:00:00",
                  "outputTemplate": "【时间】{Timestamp:yyyy-MM-dd HH:mm:ss,fff}{NewLine}【等级】[{Level}]{NewLine}【消息】[{SourceContext}] {Message:lj}{NewLine}{Exception}{NewLine}"
                }
              }
            ]
          }
        }
      },
      {
        "Name": "Logger",
        "Args": {
          "configureLogger": {
            "Filter": [
              {
                "Name": "ByIncludingOnly",
                "Args": {
                  "expression": "@l = 'Error'"
                }
              }
            ],
            "WriteTo": [
              {
                "Name": "File",
                "Args": {
                  "path": "logs/Error/.log",
                  "rollingInterval": "Day",
                  "retainedFileTimeLimit": "7.00:00:00",
                  "outputTemplate": "【时间】{Timestamp:yyyy-MM-dd HH:mm:ss,fff}{NewLine}【等级】[{Level}]{NewLine}【消息】[{SourceContext}] {Message:lj}{NewLine}{Exception}{NewLine}"
                }
              }
            ]
          }
        }
      }
    ]
  }
</code>```

I guess it is because the project is running in windows service, so the running path is under the system32 folder path, so the log relative path configured is c:\windows\system32, I want to generate the log file in the directory where the program is running

Body:
My project is c#6.0, after deploying it as a windows service, after the project runs, the log file is not generated in the directory, but in the C:\Windows\System32 folder

"Serilog": {
    "Using": [
      "Serilog.Sinks.File",
      "Serilog.Sinks.Console",
      "Serilog.Settings.Configuration",
      "Serilog.Expressions"
    ],
    "MinimumLevel": {
      "Default": "Verbose",
      "Override": {
        "Microsoft": "Warning",
        "System": "Warning",
        "Microsoft.AspNetCore": "Error",
        "Microsoft.AspNetCore.Cors.Infrastructure.CorsService": "Error",
        "Microsoft.AspNetCore.Mvc": "Error",
        "Microsoft.AspNetCore.Hosting": "Error",
        "Microsoft.Hosting.Lifetime": "Information"
      }
    },
    "WriteTo": [
      {
        "Name": "Console",
        "Args": {
          "outputTemplate": "【时间】{Timestamp:yyyy-MM-dd HH:mm:ss,fff}{NewLine}【等级】{Level}{NewLine}【消息】[{SourceContext}]{Message:lj}{NewLine}{Exception}{NewLine}"
        }
      },
      {
        "Name": "Logger",
        "Args": {
          "configureLogger": {
            "Filter": [
              {
                "Name": "ByIncludingOnly",
                "Args": {
                  "expression": "@l = 'Debug'"
                }
              }
            ],
            "WriteTo": [
              {
                "Name": "File",
                "Args": {
                  "path": "logs/Debug/.log",
                  "rollingInterval": "Day",
                  "retainedFileTimeLimit": "7.00:00:00",
                  "outputTemplate": "【时间】{Timestamp:yyyy-MM-dd HH:mm:ss,fff}{NewLine}【等级】[{Level}]{NewLine}【消息】[{SourceContext}] {Message:lj}{NewLine}{Exception}{NewLine}"
                }
              }
            ]
          }
        }
      },
      {
        "Name": "Logger",
        "Args": {
          "configureLogger": {
            "Filter": [
              {
                "Name": "ByIncludingOnly",
                "Args": {
                  "expression": "@l = 'Information'"
                }
              }
            ],
            "WriteTo": [
              {
                "Name": "File",
                "Args": {
                  "path": "logs/Information/.log",
                  "rollingInterval": "Day",
                  "retainedFileTimeLimit": "7.00:00:00",
                  "outputTemplate": "【时间】{Timestamp:yyyy-MM-dd HH:mm:ss,fff}{NewLine}【等级】[{Level}]{NewLine}【消息】[{SourceContext}] {Message:lj}{NewLine}{Exception}{NewLine}"
                }
              }
            ]
          }
        }
      },
      {
        "Name": "Logger",
        "Args": {
          "configureLogger": {
            "Filter": [
              {
                "Name": "ByIncludingOnly",
                "Args": {
                  "expression": "@l = 'Warning'"
                }
              }
            ],
            "WriteTo": [
              {
                "Name": "File",
                "Args": {
                  "path": "logs/Warning/.log",
                  "rollingInterval": "Day",
                  "retainedFileTimeLimit": "7.00:00:00",
                  "outputTemplate": "【时间】{Timestamp:yyyy-MM-dd HH:mm:ss,fff}{NewLine}【等级】[{Level}]{NewLine}【消息】[{SourceContext}] {Message:lj}{NewLine}{Exception}{NewLine}"
                }
              }
            ]
          }
        }
      },
      {
        "Name": "Logger",
        "Args": {
          "configureLogger": {
            "Filter": [
              {
                "Name": "ByIncludingOnly",
                "Args": {
                  "expression": "@l = 'Error'"
                }
              }
            ],
            "WriteTo": [
              {
                "Name": "File",
                "Args": {
                  "path": "logs/Error/.log",
                  "rollingInterval": "Day",
                  "retainedFileTimeLimit": "7.00:00:00",
                  "outputTemplate": "【时间】{Timestamp:yyyy-MM-dd HH:mm:ss,fff}{NewLine}【等级】[{Level}]{NewLine}【消息】[{SourceContext}] {Message:lj}{NewLine}{Exception}{NewLine}"
                }
              }
            ]
          }
        }
      }
    ]
  }

I guess it is because the project is running in windows service, so the running path is under the system32 folder path, so the log relative path configured is c:\windows\system32, I want to generate the log file in the directory where the program is running


问:
No matching version found for @typescript-eslint/scope-manager@5.48.1 in Vue.js
I am using the follwoing plugin in my Vite+Vue.js3 app.
`"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
currently when i run the "npm install" command in the project directory ,the following error appears

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @typescript-eslint/scope-manager@5.48.1.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

Anytimes i run the command "npm install" inside of project directory to install any packages, the install process fails.


问:
How to add multiple matplot in pyqt5?
This is my code for creating two matplot in pyqt5 but it isn't working. I hope everybody who has experience with this problem can help me. I have created two canvas are canvas1 and canvas2 but when I runtime this code it is only export only one graph.</p>
```<code>import sys
import matplotlib
matplotlib.use('Qt5Agg')

from PyQt5 import QtCore, QtGui, QtWidgets

from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure

class MplCanvas1(FigureCanvasQTAgg):

    def __init__(self, parent=None, width=5, height=4, dpi=100):
        fig = Figure(figsize=(width, height), dpi=dpi)
        self.axes = fig.add_subplot(111)
        super(MplCanvas1, self).__init__(fig)

class MplCanvas2(FigureCanvasQTAgg):

    def __init__(self, parent=None, width=5, height=4, dpi=100):
        fig = Figure(figsize=(width, height), dpi=dpi)
        self.axes = fig.add_subplot(122)
        super(MplCanvas2, self).__init__(fig)

class MainWindow(QtWidgets.QMainWindow):

    def __init__(self, *args, **kwargs):
        super(MainWindow, self).__init__(*args, **kwargs)

        sc1 = MplCanvas1(self, width=5, height=4, dpi=100)
        sc1.axes.plot([0,1,2,3,4], [10,1,20,3,40])

        sc2 = MplCanvas2(self, width=5, height=4, dpi=100)
        sc2.axes.plot([0,1,2,3,4], [10,1,20,3,40])

        # Create toolbar, passing canvas as first parament, parent (self, the MainWindow) as second.
        toolbar1 = NavigationToolbar(sc1, self)
        toolbar2 = NavigationToolbar(sc2, self)

        layout1 = QtWidgets.QVBoxLayout()
        layout1.addWidget(toolbar1)
        layout1.addWidget(sc1)

        layout2 = QtWidgets.QVBoxLayout()
        layout2.addWidget(toolbar2)
        layout2.addWidget(sc2)

        # Create a placeholder widget to hold our toolbar and canvas.
        widget1 = QtWidgets.QWidget()
        widget1.setLayout(layout1)
        widget2 = QtWidgets.QWidget()
        widget2.setLayout(layout2)

        self.setCentralWidget(widget1)
        self.setCentralWidget(widget2)

        self.show()

app = QtWidgets.QApplication(sys.argv)
w = MainWindow()
app.exec_()
</code>```

Title: How to add multiple matplot in pyqt5?

Body:
This is my code for creating two matplot in pyqt5 but it isn't working. I hope everybody who has experience with this problem can help me. I have created two canvas are canvas1 and canvas2 but when I runtime this code it is only export only one graph.

import sys
import matplotlib
matplotlib.use('Qt5Agg')

from PyQt5 import QtCore, QtGui, QtWidgets

from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure

class MplCanvas1(FigureCanvasQTAgg):

    def __init__(self, parent=None, width=5, height=4, dpi=100):
        fig = Figure(figsize=(width, height), dpi=dpi)
        self.axes = fig.add_subplot(111)
        super(MplCanvas1, self).__init__(fig)

class MplCanvas2(FigureCanvasQTAgg):

    def __init__(self, parent=None, width=5, height=4, dpi=100):
        fig = Figure(figsize=(width, height), dpi=dpi)
        self.axes = fig.add_subplot(122)
        super(MplCanvas2, self).__init__(fig)

class MainWindow(QtWidgets.QMainWindow):

    def __init__(self, *args, **kwargs):
        super(MainWindow, self).__init__(*args, **kwargs)

        sc1 = MplCanvas1(self, width=5, height=4, dpi=100)
        sc1.axes.plot([0,1,2,3,4], [10,1,20,3,40])

        sc2 = MplCanvas2(self, width=5, height=4, dpi=100)
        sc2.axes.plot([0,1,2,3,4], [10,1,20,3,40])

        # Create toolbar, passing canvas as first parament, parent (self, the MainWindow) as second.
        toolbar1 = NavigationToolbar(sc1, self)
        toolbar2 = NavigationToolbar(sc2, self)

        layout1 = QtWidgets.QVBoxLayout()
        layout1.addWidget(toolbar1)
        layout1.addWidget(sc1)

        layout2 = QtWidgets.QVBoxLayout()
        layout2.addWidget(toolbar2)
        layout2.addWidget(sc2)

        # Create a placeholder widget to hold our toolbar and canvas.
        widget1 = QtWidgets.QWidget()
        widget1.setLayout(layout1)
        widget2 = QtWidgets.QWidget()
        widget2.setLayout(layout2)

        self.setCentralWidget(widget1)
        self.setCentralWidget(widget2)

        self.show()

app = QtWidgets.QApplication(sys.argv)
w = MainWindow()
app.exec_()


问:
Xcode encrypt mlmodel and distribute outside CloudKit and outside the app
I want to encrypt my mlmodel using Xcode key but NOT bundle it in the app nor load it into CloudKit.

I want to have my app download the encrypted model and load it from file.

The encryption set up is trivial but it is not clear how to encrypt mlmodel or mlmodelc tying it to app id without including the file through Build Phases.

Or is there a way to load mlarchive?

Source for Xcode mlmodel encryption: https://developer.apple.com/documentation/coreml/encrypting_a_model_in_your_app


问:
how to toggle sidebar in redux-saga
how to toggle sidebar in react js using redux-saga, i am use the below code but its error

Reducer.tsx

```<code>const initialstate = {
    isExpanded: false,
};

function sidebarReducer(state =initialstate,action: { type: any; }){
    switch (action.type){
        case 'TOGGLE_SIDEBAR':
            return {
                ...state,
                isExpanded:
                !state.isExpanded

            };
            default:
            return state;
    }
    console.log(initialstate)
}
 console.log(initialstate)

export default sidebarReducer;
</code>```

Store.tsx

```<code>import {createStore,applyMiddleware} from "redux"
import createSagaMiddleware from "redux-saga"
import rootReducer from "./reducers/reducer"
import toggleSidebarSaga from "./sidebarSaga"

const sagaMiddleware = createSagaMiddleware();
const store = createStore(rootReducer,applyMiddleware(sagaMiddleware));
sagaMiddleware.run(toggleSidebarSaga);

export default store;
</code>```

Saga.tsx

import {takeLatest,put} from 'redux-saga/effects'

function* toggleSidebarSaga(){
yield takeLatest ('TOGGLE_SIDEBAR',
function*(){
yield put({type:'TOGGLE_SIDEBAR'});
});
}

export default toggleSidebarSaga;

Sidebar.tsx

import toggleSidebarSaga from '../../../store/sidebarSaga'

const Header = () => {
const dispatch = useDispatch()

const Toggle =() =>{

```<code>dispatch(toggleSidebarSaga());
</code>```

};

// const isExpanded=useSelector(state=>state.toggle.isExpanded);
return (
<>

```<code>  \<header id="header" className="header fixed-top d-flex align-items-center"\>
    \<div className="d-flex align-items-center justify-content-between"\>
      \<a className="logo d-flex align-items-center"\>
        \<img src="https://comptivia.net/assets/images/comptivia.png" alt="" /\>
      \</a\>

      \<FontAwesomeIcon icon={faBars} className="toggle-sidebar-btn" onClick={()=\>Toggle()} /\>
</code>```

When button click don't trigger action the error in console

Uncaught Error: Actions must be plain objects. Instead, the actual type was: ''. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.
at dispatch (redux.js:275:1)
at redux-saga-core.esm.js:1410:1
at Toggle (index.jsx:14:1)
at onClick (index.jsx:28:1)
at HTMLUnknownElement.callCallback (react-dom.development.js:4164:1)
at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:1)
at invokeGuardedCallback (react-dom.development.js:4277:1)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4291:1)
at executeDispatch (react-dom.development.js:9041:1)
at processDispatchQueueItemsInOrder (react-dom.development.js:9073:1)

Title: how to toggle sidebar in redux-saga

Body:
how to toggle sidebar in react js using redux-saga, i am use the below code but its error

Reducer.tsx

const initialstate = {
    isExpanded: false,
};

function sidebarReducer(state =initialstate,action: { type: any; }){
    switch (action.type){
        case 'TOGGLE_SIDEBAR':
            return {
                ...state,
                isExpanded:
                !state.isExpanded

            };
            default:
            return state;
    }
    console.log(initialstate)
}
 console.log(initialstate)

export default sidebarReducer;

Store.tsx

import {createStore,applyMiddleware} from "redux"
import createSagaMiddleware from "redux-saga"
import rootReducer from "./reducers/reducer"
import toggleSidebarSaga from "./sidebarSaga"

const sagaMiddleware = createSagaMiddleware();
const store = createStore(rootReducer,applyMiddleware(sagaMiddleware));
sagaMiddleware.run(toggleSidebarSaga);

export default store;

Saga.tsx

import {takeLatest,put} from 'redux-saga/effects'

function* toggleSidebarSaga(){
yield takeLatest ('TOGGLE_SIDEBAR',
function*(){
yield put({type:'TOGGLE_SIDEBAR'});
});
}

export default toggleSidebarSaga;

Sidebar.tsx

import toggleSidebarSaga from '../../../store/sidebarSaga'

const Header = () => {
const dispatch = useDispatch()

const Toggle =() =>{

dispatch(toggleSidebarSaga());

};

// const isExpanded=useSelector(state=>state.toggle.isExpanded);
return (
<>

  \
    \

      \
        \
      \

      \<FontAwesomeIcon icon={faBars} className="toggle-sidebar-btn" onClick={()=\>Toggle()} /\>

When button click don't trigger action the error in console

Uncaught Error: Actions must be plain objects. Instead, the actual type was: ''. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.
at dispatch (redux.js:275:1)
at redux-saga-core.esm.js:1410:1
at Toggle (index.jsx:14:1)
at onClick (index.jsx:28:1)
at HTMLUnknownElement.callCallback (react-dom.development.js:4164:1)
at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:1)
at invokeGuardedCallback (react-dom.development.js:4277:1)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4291:1)
at executeDispatch (react-dom.development.js:9041:1)
at processDispatchQueueItemsInOrder (react-dom.development.js:9073:1)


问:
Atmel SAM4E Bootloader support
I've to write  boot loader for the Atmel SAM4E device .but I'm not sure how to write.
I'm very new to writing code for ARM, so I'd appreciate any help.</p>

Title: Atmel SAM4E Bootloader support


问:
Curve Fitting Data to a Function containing an Integral
I have the following set of data I'm trying to curve fit

```<code>import numpy as np

y = [145,145,146,145,145,145,145,144,143,142,140,138,134,129,122,114,106,96,86,76,67,57,48,39,32,24,18,12,8]
x = np.linspace(0, 500*(len(y) - 1), len(y))
</code>```

I imagine this is a pretty straightforward task but the function I'm curve fitting it to contains the following integral which is making life difficult:
enter image description here

I've tried the following but I understand its far from correct as I'm not sure how to include x in the bounds of the integral:

```<code>def integrand(x, a, b, c):
    return a*np.exp(-(x-b)**2/(2*c**2))

def curve(a, b, c):
    res = scipy.integrate.quad(integrand, x, np.inf, [a, b, c])
    return res[0]

vcurve = np.vectorize(curve, excluded=set([1]))

popt, pcov = scipy.optimize.curve_fit(vcurve, displacement, power, p0=[2.0])
print(popt)

</code>```

Any help would be greatly appreciated. Thanks

Body:
I have the following set of data I'm trying to curve fit

import numpy as np

y = [145,145,146,145,145,145,145,144,143,142,140,138,134,129,122,114,106,96,86,76,67,57,48,39,32,24,18,12,8]
x = np.linspace(0, 500*(len(y) - 1), len(y))

I imagine this is a pretty straightforward task but the function I'm curve fitting it to contains the following integral which is making life difficult:
enter image description here

I've tried the following but I understand its far from correct as I'm not sure how to include x in the bounds of the integral:

def integrand(x, a, b, c):
    return a*np.exp(-(x-b)**2/(2*c**2))

def curve(a, b, c):
    res = scipy.integrate.quad(integrand, x, np.inf, [a, b, c])
    return res[0]

vcurve = np.vectorize(curve, excluded=set([1]))

popt, pcov = scipy.optimize.curve_fit(vcurve, displacement, power, p0=[2.0])
print(popt)

Any help would be greatly appreciated. Thanks


问:
Want to convert pdf image created using "matplotlib.backends.backend_pdf import PdfPages" package to byte array
I am using "matplotlib.backends.backend_pdf" package to create pdf and to store the plot created using matplotlib. But, apart from saving the pdf image in my repository, I want to return a byte array of this pdf. (Note: I don't want to read the pdf file and convert it to byte array).</p>
```<code>from matplotlib.backends.backend_pdf import PdfPages
import numpy as np
import matplotlib.pyplot as plt

x1 = np.arange(10)
y1 = x1**2

x2 = np.arange(20)
y2 = x2**2

pp = PdfPages('test.pdf')

def function_plot(X,Y):
    plt.figure()
    plt.clf()

    plt.plot(X,Y)
    plt.title('y vs x')
    plt.xlabel('x axis', fontsize = 13)
    plt.ylabel('y axis', fontsize = 13)
    pp.savefig()

function_plot(x1,y1)
function_plot(x2,y2)

pp.close()
</code>```

Body:
I am using "matplotlib.backends.backend_pdf" package to create pdf and to store the plot created using matplotlib. But, apart from saving the pdf image in my repository, I want to return a byte array of this pdf. (Note: I don't want to read the pdf file and convert it to byte array).

from matplotlib.backends.backend_pdf import PdfPages
import numpy as np
import matplotlib.pyplot as plt

x1 = np.arange(10)
y1 = x1**2

x2 = np.arange(20)
y2 = x2**2

pp = PdfPages('test.pdf')

def function_plot(X,Y):
    plt.figure()
    plt.clf()

    plt.plot(X,Y)
    plt.title('y vs x')
    plt.xlabel('x axis', fontsize = 13)
    plt.ylabel('y axis', fontsize = 13)
    pp.savefig()

function_plot(x1,y1)
function_plot(x2,y2)

pp.close()


问:
Firebase realtime database rule to allow user to access the path
In my firebase realtime database, there are two pathes: "/companies" and "/users". Please refer to the attached picture.
The users in "/users" correspond to the Authentication users of the realtime database with the same identifier value.
I want to only allow the user who belows to the company be able to read/write the data of the company.

For example, in below table, user "Re" belows to company "Technology" and user "Test Human" doesn't belows to. Then authentication user "Re" can access the "companies/Technology/*" but "Test Human" cannot.

Is it possible to apply a rule of realtime database to achieve this purpose?

```<code>{
 "rules": {
   ".read": "auth.uid !== null",
   ".write": "auth.uid !== null"
 }
}
</code>```

Body:
In my firebase realtime database, there are two pathes: "/companies" and "/users". Please refer to the attached picture.
The users in "/users" correspond to the Authentication users of the realtime database with the same identifier value.
I want to only allow the user who belows to the company be able to read/write the data of the company.

For example, in below table, user "Re" belows to company "Technology" and user "Test Human" doesn't belows to. Then authentication user "Re" can access the "companies/Technology/*" but "Test Human" cannot.

Is it possible to apply a rule of realtime database to achieve this purpose?

{
 "rules": {
   ".read": "auth.uid !== null",
   ".write": "auth.uid !== null"
 }
}


问:
How resolve the memory leak due to TextToSpeech?
```<code>android.speech.tts.TextToSpeech$Connection$1 instance
    │    Leaking: UNKNOWN
    │    Retaining 3.6 MB in 5653 objects
    │    Anonymous subclass of android.speech.tts.ITextToSpeechCallback$Stub
    │    ↓ TextToSpeech$Connection$1.this$1
    │                                ~~~~~~
    ├─ android.speech.tts.TextToSpeech$Connection instance
    │    Leaking: UNKNOWN
    │    Retaining 3.6 MB in 5652 objects
    │    ↓ TextToSpeech$Connection.this$0
    │                              ~~~~~~
    ├─ android.speech.tts.TextToSpeech instance
    │    Leaking: UNKNOWN
    │    Retaining 3.6 MB in 5651 objects
    │    mContext instance of com.simpragma.awesomebanklatest.ui.VoiTextBotActivity with mDestroyed = true
    │    ↓ TextToSpeech.mContext
    │                   ~~~~~~~~
    ╰→ com.simpragma.awesomebanklatest.ui.VoiTextBotActivity instance
         Leaking: YES (ObjectWatcher was watching this because com.simpragma.awesomebanklatest.ui.VoiTextBotActivity
         received Activity#onDestroy() callback and Activity#mDestroyed is true)
         Retaining 3.6 MB in 5638 objects
         key = 3d01484b-ab16-45a9-a509-3aaf5a64bcc4
         watchDurationMillis = 5752
         retainedDurationMillis = 742
         mApplication instance of com.simpragma.awesomebanklatest.di.BaseApplication
         mBase instance of androidx.appcompat.view.ContextThemeWrapper
</code>```


问:
Android Dynamic Feature module - How can i access class, fragment and all resources
How to access dynamic feature module class,fragment and it's function?, I need to access all module file and main app file both accessbile so its possbile?

for example DynamicFeature(Module) has fragment and class so i need to access in main project
and also call main to DynamicFeature


问:
linalgerror: 2-th leading minor of the array is not positive definite and linalgerror(matrix is not positive definite)
I am making an animation based on data from a DataFrame, using graphics frames with seaborn, however the animation generally throws me the following error:

LinAlgError: 2-th leading minor of the array is not positive definite

Next I add python script:

```<code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime, timedelta
import seaborn as sns
import time

DF=pd.read_csv('Data.txt',header=None)
DF.columns=['Fecha','A','B','C']

DF['A']=DF['A'].astype(float)
DF['B']=DF['B'].astype(float)
DF['C']=DF['C'].astype(float)

DF.index=DF['Fecha']

Tasa.index=pd.to_datetime(Tasa.index)

aux=DF.loc['2013-01-01 00:00:00':'2013-01-01 23:59:00']

from matplotlib.animation import FuncAnimation
fig=plt.figure(figsize=(10,10))
ax=fig.gca()

def create_frame(step,ax):
    ax.cla()
    sns.kdeplot(data=aux.iloc[:step], x='B',y='A', ax=ax,
                cmap='viridis',shade=True,shade_lowest=False)

    ax.set_ylabel('A',fontsize=20)
    ax.set_xlabel('B',fontsize=20)
    ax.set_ylim(4,10)
    ax.set_xlim(4,10)
    ax.tick_params(axis='x',labelsize=20)
    ax.tick_params(axis='y',labelsize=20)
    ax.grid(linewidth=2)
    ax.set_title(str(aux['Fecha'].iloc[:step] ))

anim=FuncAnimation(fig,create_frame,frames=1440,fargs=(ax,))

anim.save('animation.mp4',writer='ffmpeg',fps=60)
</code>```

Any help is much appreciated.

I've tried some similar suggestions, but they don't solve the problem.
This error mainly affects the option to save in mp4 format.

Next I add a slice of the dataset I'm using.

```<code>Fecha,A,B,C
2013-01-01 00:00:00,6.14087783553993,6.487094209889805,-5.812500000000043
2013-01-01 00:01:00,6.142852535618053,6.451151448479498,-6.479166666666695
2013-01-01 00:02:00,6.135161728680298,6.434668659127371,-6.666666666666762
2013-01-01 00:03:00,6.188886372909593,6.409028544192662,-7.333333333333295
2013-01-01 00:04:00,6.151913845842533,6.44487051044415,-6.770833333333334
2013-01-01 00:05:00,6.264562948351688,6.454411146060466,-6.916666666666771
2013-01-01 00:06:00,6.242234273068323,6.445308053843112,-7.124999999999915
2013-01-01 00:07:00,6.174932891782772,6.441722354264567,-7.000000000000028
2013-01-01 00:08:00,6.232038731245972,6.449937844249292,-6.645833333333329
2013-01-01 00:09:00,6.165174653417497,6.467040915461258,-6.270833333333314
2013-01-01 00:10:00,6.3853883237758176,6.458878459987318,-7.083333333333286
2013-01-01 00:11:00,6.263194509011096,6.448655111416813,-7.312499999999981
2013-01-01 00:12:00,6.283530864000003,6.446058367626999,-7.4583333333333
2013-01-01 00:13:00,6.215382913023543,6.4055179472255785,-7.520833333333362
2013-01-01 00:14:00,6.1934735566462695,6.393851353700702,-7.458333333333418
2013-01-01 00:15:00,6.217458716653447,6.401671059300935,-7.145833333333348
2013-01-01 00:16:00,6.246137997753354,6.385379292241588,-7.395833333333357
2013-01-01 00:17:00,6.231281865441651,6.481968657909833,-6.375000000000004
2013-01-01 00:18:00,6.254048996078586,6.480787804043361,-6.541666666666639
2013-01-01 00:19:00,6.239227657414273,6.442150833993681,-6.270833333333314
2013-01-01 00:20:00,6.228536760812165,6.424125431870682,-6.270833333333314
2013-01-01 00:21:00,6.342729054767704,6.507853124943582,-5.916666666666734
2013-01-01 00:22:00,6.277015536846364,6.566158716794105,-5.7499999999999805
2013-01-01 00:23:00,6.568085114893764,6.519808967968322,-6.124999999999995
2013-01-01 00:24:00,6.498786250312206,6.519527637569746,-7.750000000000057
2013-01-01 00:25:00,6.416404536231541,6.601184637534719,-6.6041666666667
2013-01-01 00:26:00,6.35785606805381,6.747693362719629,-5.229166666666647
2013-01-01 00:27:00,6.495290996211007,6.713164189951006,-4.895833333333263
2013-01-01 00:28:00,6.294243543455379,6.572239151386452,-6.124999999999995
2013-01-01 00:29:00,6.398427884041256,6.557709169003854,-5.666666666666606
2013-01-01 00:30:00,6.878968144462191,6.631035770653698,-8.291666666666703
2013-01-01 00:31:00,6.8146252442834125,6.746498980678764,-8.437500000000023
2013-01-01 00:32:00,6.6844198909588,6.839763930725028,-7.91666666666669
2013-01-01 00:33:00,6.728784128217531,6.817158938901811,-7.333333333333295
2013-01-01 00:34:00,6.498238450745685,6.528099885819473,-8.000000000000066
2013-01-01 00:35:00,6.480660437855158,6.42654969045868,-8.52083333333328
2013-01-01 00:36:00,6.3860584491998,6.628162243121135,-7.4583333333333
2013-01-01 00:37:00,6.384143104338095,6.485055601614159,-6.895833333333338
2013-01-01 00:38:00,6.45619773851706,6.519968088488411,-6.937499999999967
2013-01-01 00:39:00,6.421997543203723,6.434096445944022,-6.70833333333339
2013-01-01 00:40:00,6.881147741740976,6.578590558037391,-7.541666666666677
2013-01-01 00:41:00,6.953754263971081,6.628791153680949,-9.958333333333396
2013-01-01 00:42:00,6.523773291513463,6.5788512074530665,-9.62500000000001
2013-01-01 00:43:00,6.444777581496862,6.576165879949302,-8.229166666666643
2013-01-01 00:44:00,6.574984483899018,6.594732317419947,-7.56249999999999
2013-01-01 00:45:00,6.574447377672005,6.614991689474629,-8.145833333333385
2013-01-01 00:46:00,6.288316930989483,6.594510925404618,-8.020833333333382
2013-01-01 00:47:00,6.188025686773623,6.579700619293616,-7.125000000000033
2013-01-01 00:48:00,6.365197487415873,6.538544964933211,-6.979166666666595
2013-01-01 00:49:00,6.515438957534605,6.570519350260649,-8.187500000000014
2013-01-01 00:50:00,6.380516809904227,6.799245312056565,-6.270833333333314
2013-01-01 00:51:00,6.386125396297558,7.042725808100298,-3.6666666666667664
2013-01-01 00:52:00,6.354051236532193,6.858146201951583,-4.58333333333331
2013-01-01 00:53:00,6.212102833544907,6.903736224451984,-3.8749999999999103
2013-01-01 00:54:00,6.15850848072259,6.610161808661356,-4.499999999999933
2013-01-01 00:55:00,6.171615592855998,6.761485582969952,-3.937499999999972
2013-01-01 00:56:00,6.170714336159644,6.722566953339712,-3.5208333333334467
2013-01-01 00:57:00,6.188783235230519,6.633411053647084,-3.791666666666652
2013-01-01 00:58:00,6.214425142758532,6.706620958764833,-4.062499999999977
2013-01-01 00:59:00,6.204858772635459,6.695525774296802,-4.499999999999933
</code>```

Body:
I am making an animation based on data from a DataFrame, using graphics frames with seaborn, however the animation generally throws me the following error:

LinAlgError: 2-th leading minor of the array is not positive definite

Next I add python script:

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime, timedelta
import seaborn as sns
import time

DF=pd.read_csv('Data.txt',header=None)
DF.columns=['Fecha','A','B','C']

DF['A']=DF['A'].astype(float)
DF['B']=DF['B'].astype(float)
DF['C']=DF['C'].astype(float)

DF.index=DF['Fecha']

Tasa.index=pd.to_datetime(Tasa.index)

aux=DF.loc['2013-01-01 00:00:00':'2013-01-01 23:59:00']

from matplotlib.animation import FuncAnimation
fig=plt.figure(figsize=(10,10))
ax=fig.gca()

def create_frame(step,ax):
    ax.cla()
    sns.kdeplot(data=aux.iloc[:step], x='B',y='A', ax=ax,
                cmap='viridis',shade=True,shade_lowest=False)

    ax.set_ylabel('A',fontsize=20)
    ax.set_xlabel('B',fontsize=20)
    ax.set_ylim(4,10)
    ax.set_xlim(4,10)
    ax.tick_params(axis='x',labelsize=20)
    ax.tick_params(axis='y',labelsize=20)
    ax.grid(linewidth=2)
    ax.set_title(str(aux['Fecha'].iloc[:step] ))

anim=FuncAnimation(fig,create_frame,frames=1440,fargs=(ax,))

anim.save('animation.mp4',writer='ffmpeg',fps=60)

Any help is much appreciated.

I've tried some similar suggestions, but they don't solve the problem.
This error mainly affects the option to save in mp4 format.

Next I add a slice of the dataset I'm using.

Fecha,A,B,C
2013-01-01 00:00:00,6.14087783553993,6.487094209889805,-5.812500000000043
2013-01-01 00:01:00,6.142852535618053,6.451151448479498,-6.479166666666695
2013-01-01 00:02:00,6.135161728680298,6.434668659127371,-6.666666666666762
2013-01-01 00:03:00,6.188886372909593,6.409028544192662,-7.333333333333295
2013-01-01 00:04:00,6.151913845842533,6.44487051044415,-6.770833333333334
2013-01-01 00:05:00,6.264562948351688,6.454411146060466,-6.916666666666771
2013-01-01 00:06:00,6.242234273068323,6.445308053843112,-7.124999999999915
2013-01-01 00:07:00,6.174932891782772,6.441722354264567,-7.000000000000028
2013-01-01 00:08:00,6.232038731245972,6.449937844249292,-6.645833333333329
2013-01-01 00:09:00,6.165174653417497,6.467040915461258,-6.270833333333314
2013-01-01 00:10:00,6.3853883237758176,6.458878459987318,-7.083333333333286
2013-01-01 00:11:00,6.263194509011096,6.448655111416813,-7.312499999999981
2013-01-01 00:12:00,6.283530864000003,6.446058367626999,-7.4583333333333
2013-01-01 00:13:00,6.215382913023543,6.4055179472255785,-7.520833333333362
2013-01-01 00:14:00,6.1934735566462695,6.393851353700702,-7.458333333333418
2013-01-01 00:15:00,6.217458716653447,6.401671059300935,-7.145833333333348
2013-01-01 00:16:00,6.246137997753354,6.385379292241588,-7.395833333333357
2013-01-01 00:17:00,6.231281865441651,6.481968657909833,-6.375000000000004
2013-01-01 00:18:00,6.254048996078586,6.480787804043361,-6.541666666666639
2013-01-01 00:19:00,6.239227657414273,6.442150833993681,-6.270833333333314
2013-01-01 00:20:00,6.228536760812165,6.424125431870682,-6.270833333333314
2013-01-01 00:21:00,6.342729054767704,6.507853124943582,-5.916666666666734
2013-01-01 00:22:00,6.277015536846364,6.566158716794105,-5.7499999999999805
2013-01-01 00:23:00,6.568085114893764,6.519808967968322,-6.124999999999995
2013-01-01 00:24:00,6.498786250312206,6.519527637569746,-7.750000000000057
2013-01-01 00:25:00,6.416404536231541,6.601184637534719,-6.6041666666667
2013-01-01 00:26:00,6.35785606805381,6.747693362719629,-5.229166666666647
2013-01-01 00:27:00,6.495290996211007,6.713164189951006,-4.895833333333263
2013-01-01 00:28:00,6.294243543455379,6.572239151386452,-6.124999999999995
2013-01-01 00:29:00,6.398427884041256,6.557709169003854,-5.666666666666606
2013-01-01 00:30:00,6.878968144462191,6.631035770653698,-8.291666666666703
2013-01-01 00:31:00,6.8146252442834125,6.746498980678764,-8.437500000000023
2013-01-01 00:32:00,6.6844198909588,6.839763930725028,-7.91666666666669
2013-01-01 00:33:00,6.728784128217531,6.817158938901811,-7.333333333333295
2013-01-01 00:34:00,6.498238450745685,6.528099885819473,-8.000000000000066
2013-01-01 00:35:00,6.480660437855158,6.42654969045868,-8.52083333333328
2013-01-01 00:36:00,6.3860584491998,6.628162243121135,-7.4583333333333
2013-01-01 00:37:00,6.384143104338095,6.485055601614159,-6.895833333333338
2013-01-01 00:38:00,6.45619773851706,6.519968088488411,-6.937499999999967
2013-01-01 00:39:00,6.421997543203723,6.434096445944022,-6.70833333333339
2013-01-01 00:40:00,6.881147741740976,6.578590558037391,-7.541666666666677
2013-01-01 00:41:00,6.953754263971081,6.628791153680949,-9.958333333333396
2013-01-01 00:42:00,6.523773291513463,6.5788512074530665,-9.62500000000001
2013-01-01 00:43:00,6.444777581496862,6.576165879949302,-8.229166666666643
2013-01-01 00:44:00,6.574984483899018,6.594732317419947,-7.56249999999999
2013-01-01 00:45:00,6.574447377672005,6.614991689474629,-8.145833333333385
2013-01-01 00:46:00,6.288316930989483,6.594510925404618,-8.020833333333382
2013-01-01 00:47:00,6.188025686773623,6.579700619293616,-7.125000000000033
2013-01-01 00:48:00,6.365197487415873,6.538544964933211,-6.979166666666595
2013-01-01 00:49:00,6.515438957534605,6.570519350260649,-8.187500000000014
2013-01-01 00:50:00,6.380516809904227,6.799245312056565,-6.270833333333314
2013-01-01 00:51:00,6.386125396297558,7.042725808100298,-3.6666666666667664
2013-01-01 00:52:00,6.354051236532193,6.858146201951583,-4.58333333333331
2013-01-01 00:53:00,6.212102833544907,6.903736224451984,-3.8749999999999103
2013-01-01 00:54:00,6.15850848072259,6.610161808661356,-4.499999999999933
2013-01-01 00:55:00,6.171615592855998,6.761485582969952,-3.937499999999972
2013-01-01 00:56:00,6.170714336159644,6.722566953339712,-3.5208333333334467
2013-01-01 00:57:00,6.188783235230519,6.633411053647084,-3.791666666666652
2013-01-01 00:58:00,6.214425142758532,6.706620958764833,-4.062499999999977
2013-01-01 00:59:00,6.204858772635459,6.695525774296802,-4.499999999999933


问:
Multiple Files download using JSZip but the downloaded PDFs are not opening
I am implementing JSZIP using the following code and in result the downloaded Zip file PDFs don't open. I am making some minor mistake while creating the Zip I am not sure what.

```<code>jQuery.fn.downloadfiles = function myfunction(){
//Preparing To Compress Files to Download
var zip = new JSZip();
var folder = zip.folder("Datasheets");
var errtxt = "NO CONTENTS FOUND";
    for(let i = 0; i < arr.length; i++){
        //console.log('singlePdf', arr[i]);
        var blobPromise = fetch(arr).then((r) => {
            if (r.status === 200) return r.blob();
            return errtxt;
        });
        var filename = arr[i].substring(arr[i].lastIndexOf('/')+1);
        //console.log(filename);
        //zip.file('file-' + i + '.pdf', filename);
        folder.file(filename, blobPromise);
    }

    zip.generateAsync({type:"blob"}).then(function(blob) {
        // see FileSaver.js
        saveAs(blob, "Datasheets.zip");
    });

} //Ending Function

jQuery(".btn-download").click(function(){
    jQuery.fn.downloadfiles();
}
</code>```

Please help with this, I will really appreciate it.

Body:
I am implementing JSZIP using the following code and in result the downloaded Zip file PDFs don't open. I am making some minor mistake while creating the Zip I am not sure what.

jQuery.fn.downloadfiles = function myfunction(){
//Preparing To Compress Files to Download
var zip = new JSZip();
var folder = zip.folder("Datasheets");
var errtxt = "NO CONTENTS FOUND";
    for(let i = 0; i < arr.length; i++){
        //console.log('singlePdf', arr[i]);
        var blobPromise = fetch(arr).then((r) => {
            if (r.status === 200) return r.blob();
            return errtxt;
        });
        var filename = arr[i].substring(arr[i].lastIndexOf('/')+1);
        //console.log(filename);
        //zip.file('file-' + i + '.pdf', filename);
        folder.file(filename, blobPromise);
    }

    zip.generateAsync({type:"blob"}).then(function(blob) {
        // see FileSaver.js
        saveAs(blob, "Datasheets.zip");
    });

} //Ending Function

jQuery(".btn-download").click(function(){
    jQuery.fn.downloadfiles();
}

Please help with this, I will really appreciate it.


问:
Nodejs HTTP.request different timeouts on different systems
I have 2 systems using Nodejs 16.19.0 - one on my local Windows 11 and another in a GKE pod running a Ubuntu 20 container.
In both systems, I open an interactive Nodejs prompt and run the following, pointing to some IP address that I know will NOT reply and cause a timeout on the client side:

```<code>$ node # open interactive nodejs prompt and run the following at once:

console.log(new Date());
req=http.request('http://x.x.x.x');
req.on('error', ()=>{}); // just to cleanup the output
req.on('close', () => { console.log('close ' + new Date()); });
</code>```

I print the start and end dates to see how long it takes the client to close with the timeout.

In my local system, it takes ~20 seconds. In the other system, it takes 130 seconds. I didn't configure anything special in my Node. Why is there a difference?

Also, the consequence of this, is that when I also add a "timeout" handler for, say, 30 seconds, it will NOT fire on Windows and WILL fire in the pod...

Body:
I have 2 systems using Nodejs 16.19.0 - one on my local Windows 11 and another in a GKE pod running a Ubuntu 20 container.
In both systems, I open an interactive Nodejs prompt and run the following, pointing to some IP address that I know will NOT reply and cause a timeout on the client side:

$ node # open interactive nodejs prompt and run the following at once:

console.log(new Date());
req=http.request('http://x.x.x.x');
req.on('error', ()=>{}); // just to cleanup the output
req.on('close', () => { console.log('close ' + new Date()); });

I print the start and end dates to see how long it takes the client to close with the timeout.

In my local system, it takes ~20 seconds. In the other system, it takes 130 seconds. I didn't configure anything special in my Node. Why is there a difference?

Also, the consequence of this, is that when I also add a "timeout" handler for, say, 30 seconds, it will NOT fire on Windows and WILL fire in the pod...


问:
how combines(concat) InvType, Invoice_no, Inv_Dt,
const postSchema = mongoose.Schema(
{
Invoice_Desc:
{
type: Array,
required: true,
properties:
{
taxschema:
{
type: String,
description: "Tax Type",
example: "VAT",
},
InvType:
{
type: String,
description: "type of Invoice",
example: "INV",
},
Invoice_no:
{
type: String,
description: "Invoice Number",
example: false
},
Inv_Dt:
{
type: String,
description: "Invoice Date",
example: false
},
},
},

const postSchema = mongoose.Schema(
{
Invoice_Desc:
{
type: Array,
required: true,
properties:
{
taxschema:
{
type: String,
description: "Tax Type",
example: "VAT",
},
InvType:
{
type: String,
description: "type of Invoice",
example: "INV",
},
Invoice_no:
{
type: String,
description: "Invoice Number",
example: false
},
Inv_Dt:
{
type: String,
description: "Invoice Date",
example: false
},
},
},


问:
It is necessary to send alerts to Telegram bot from Teams using webhook_url
The program will hang on the server and work around the clock. It is necessary to catch the received message in the Microsoft-Teams group (channel) via webhook_url and send at least one message (preferably a whole message) to the bot's Telegram. I write code on the pluses as I don’t know anything other than them. Below is the code. The code did not work for me, if there are any ideas or suggestions on how to improve what I am certainly happy about. Thanks in advance.</p>
```<code>#include <iostream>
#include <string>
#include <curl/curl.h> // Library for working with HTTP requests
using namespace std;

// Incoming webhook URL created in Teams
const string webhook_url = "Webhook from Tims";

// Telegram bot access token
const string bot_token = "Bot token";

// Telegram chat ID where to send notifications
const string chat_id = "Bot name";

size_t write_callback(void* ptr, size_t size, size_t nmemb, void* userdata) {
    // The callback function used to store the server's response
    string* response = (string*)userdata;
    response->append((char*)ptr, size * nmemb);
    return size * nmemb;
}

void send_webhook_message(const string& text, const string& bot_token, const string& chat_id) {
    // Function for sending a webhook message through a bot in Telegram
    CURL* curl = curl_easy_init();
    if (curl) {
        string response;
        curl_easy_setopt(curl, CURLOPT_URL, ("https://t.me/ITSys****" + bot_token + "/sendMessage").c_str());
        curl_easy_setopt(curl, CURLOPT_POST, 1);
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, ("chat_id=" + chat_id + "&text=" + text).c_str());
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
        curl_easy_perform(curl);
        curl_easy_cleanup(curl);
    }
}
int main ()
{for ( ; ; )
{

}
return 0;
}
</code>```

Body:
The program will hang on the server and work around the clock. It is necessary to catch the received message in the Microsoft-Teams group (channel) via webhook_url and send at least one message (preferably a whole message) to the bot's Telegram. I write code on the pluses as I don’t know anything other than them. Below is the code. The code did not work for me, if there are any ideas or suggestions on how to improve what I am certainly happy about. Thanks in advance.

#include <iostream>
#include <string>
#include <curl/curl.h> // Library for working with HTTP requests
using namespace std;

// Incoming webhook URL created in Teams
const string webhook_url = "Webhook from Tims";

// Telegram bot access token
const string bot_token = "Bot token";

// Telegram chat ID where to send notifications
const string chat_id = "Bot name";

size_t write_callback(void* ptr, size_t size, size_t nmemb, void* userdata) {
    // The callback function used to store the server's response
    string* response = (string*)userdata;
    response->append((char*)ptr, size * nmemb);
    return size * nmemb;
}

void send_webhook_message(const string& text, const string& bot_token, const string& chat_id) {
    // Function for sending a webhook message through a bot in Telegram
    CURL* curl = curl_easy_init();
    if (curl) {
        string response;
        curl_easy_setopt(curl, CURLOPT_URL, ("https://t.me/ITSys****" + bot_token + "/sendMessage").c_str());
        curl_easy_setopt(curl, CURLOPT_POST, 1);
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, ("chat_id=" + chat_id + "&text=" + text).c_str());
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
        curl_easy_perform(curl);
        curl_easy_cleanup(curl);
    }
}
int main ()
{for ( ; ; )
{

}
return 0;
}