问:
C# Microsoft Identity Framework multitenant application authenticate with guest accounts
I'm building a multitenant application that also needs to sign guest users (users added as guests, not anonymous). The guest must be able to access resources in the tenant. For example:

User X from Tenant A is a guest in Tenant B. Must be able to access resources in Tenant B

User Y is an account from an external provider. It is also a guest in Tenant B. Must be able to access resources in Tenant B

User Z is an account from an external provider. It is a guest in Tenant C. Must be able to access resources in Tenant C

Each user selects the tenant they want to interact with, so obtaining the tenantId is not an issue.

Microsoft Identity Framework really simplifies the configuration for the most common cases, but I can't find a way to configure the application with multitenant AND guest users.

My code is fairly standard:

```<code>services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
        .AddMicrosoftIdentityWebApp(options =>
        {
            Configuration.Bind("AzureAd", options);
        }
        )
</code>```

And in the controller

```<code>[HttpGet]
[AuthorizeForScopes(Scopes = new string[] { GraphScope.FilesReadAll })]
public async Task<IActionResult> Index(string driveId, string tenantId)
{
    var accessToken = await _tokenAcquisition.GetAccessTokenForUserAsync(new string[] { GraphScope.FilesReadAll }, tenantId: tenantId);
    //etc
}

</code>```

I mainly followed the examples from here

Main problems:

[AuthorizeForScopes] uses static scopes, so it is impossible to use a scope from another tenant (can't do for example {tenantUrl}/.default)

I can't use the "common" authority (as in "https://login.microsoftonline.com/common") since I need users to get claims from a specific tenant.

I was able to use a flow similar the one for AuthorizeForScopes while obtaining the token. My idea was to return a ChallengeResult action with the specific authority, but I can't find information on how to configure it, or if that's even possible.

```<code>try
{
    var accessToken = await _tokenAcquisition.GetAccessTokenForUserAsync ...
}
catch (someAuthException)
{
    return ChallengeResult ...
}
</code>```

Is there a way to do so, or is there a simpler way to accomplish what I try to do?

Body:
I'm building a multitenant application that also needs to sign guest users (users added as guests, not anonymous). The guest must be able to access resources in the tenant. For example:

User X from Tenant A is a guest in Tenant B. Must be able to access resources in Tenant B

User Y is an account from an external provider. It is also a guest in Tenant B. Must be able to access resources in Tenant B

User Z is an account from an external provider. It is a guest in Tenant C. Must be able to access resources in Tenant C

Each user selects the tenant they want to interact with, so obtaining the tenantId is not an issue.

Microsoft Identity Framework really simplifies the configuration for the most common cases, but I can't find a way to configure the application with multitenant AND guest users.

My code is fairly standard:

services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
        .AddMicrosoftIdentityWebApp(options =>
        {
            Configuration.Bind("AzureAd", options);
        }
        )

And in the controller

[HttpGet]
[AuthorizeForScopes(Scopes = new string[] { GraphScope.FilesReadAll })]
public async Task<IActionResult> Index(string driveId, string tenantId)
{
    var accessToken = await _tokenAcquisition.GetAccessTokenForUserAsync(new string[] { GraphScope.FilesReadAll }, tenantId: tenantId);
    //etc
}

I mainly followed the examples from here

Main problems:

[AuthorizeForScopes] uses static scopes, so it is impossible to use a scope from another tenant (can't do for example {tenantUrl}/.default)

I can't use the "common" authority (as in "https://login.microsoftonline.com/common") since I need users to get claims from a specific tenant.

I was able to use a flow similar the one for AuthorizeForScopes while obtaining the token. My idea was to return a ChallengeResult action with the specific authority, but I can't find information on how to configure it, or if that's even possible.

try
{
    var accessToken = await _tokenAcquisition.GetAccessTokenForUserAsync ...
}
catch (someAuthException)
{
    return ChallengeResult ...
}

Is there a way to do so, or is there a simpler way to accomplish what I try to do?


来源: stackexchange

问:
SQL Server Managed Instance database properties window getting “Subquery returned more than 1 value” error message
Error

Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. (.Net SqlClient Data Provider)"

window prompt when opening database properties

Tried to run this script

```<code>EXEC msdb.dbo.sp_delete_database_backuphistory
          @database_name = N’<DBName>’
</code>```

to delete the backup history - but the issue persists.

ContentLicense: CC BY-SA 4.0

Body:
Error

Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. (.Net SqlClient Data Provider)"

window prompt when opening database properties

Tried to run this script

EXEC msdb.dbo.sp_delete_database_backuphistory
          @database_name = N’<DBName>’

to delete the backup history - but the issue persists.


问:
finding the number of parameters and the model size of extreme gradient boosting (xgboost) regressor
I am using a xgboost regressor with all defult parameters for a computer vision project. I am asked to calculate the model size and number of the parameters for my model. How can I do this?

I have seen this post on the matter but not sure I should trust to this.

https://datascience.stackexchange.com/questions/82918/counting-the-number-of-trainable-parameters-in-a-gradient-boosted-tree


问:
JQuery - upload and show preview image (based on ZURB)
I'm newbie in scripting and try to follow Zurb articles on Image Uploads with 100% Less Suck. Guaranteed. But still can not make it right. On requirement said that I need JQuery and AjaxUpload plugin. So I do make links to files needed:

```<code><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="http://www.zurb.com/javascripts/plugins/ajaxupload.js"></script>
</code>```

(Sorry Zurb and others that I use the links, I use the file for educational purpose only. I don't mean anything bad)

This is the script that I follow from Zurb

JQUERY

```<code>$(document).ready(function(){
    var thumb = $('img#thumb');

    new AjaxUpload('imageUpload', {
        action: $('form#testForm').attr('action'),
        name: 'image',
        onSubmit: function(file, extension) {
            $('div.preview').addClass('loading');
        },
        onComplete: function(file, response) {
            thumb.load(function(){
                $('div.preview').removeClass('loading');
                thumb.unbind();
            });
            thumb.attr('src', response);
        }
    });
});
</code>```

CSS

```<code>span.wrap { padding: 10px; }
        span.wrap.new { margin-left: 30px; }
        span.wrap button { display: block; margin-top: 10px; }
        span.wrap label { margin-bottom: 5px; }
        div.preview { float: left; width: 100px; height: 100px; border: 2px dotted #CCCCCC; }
        div.preview.loading { background: url(http://www.woningcorporatie-processen.nl/static/modules/sensus/images/loading.gif) no-repeat 39px 40px; }
        div.preview.loading img {display: none; }
        input#imageUpload { width: 400px; }
        span.wrap form { margin: 0; }
</code>```

HTML

```<code><div class="wrap">

    <div class="preview">
        <img id="thumb" width="100px" height="100px" src="https://greenhouse.lotus.com/plugins/plugincatalog.nsf/blankLogo.gif" />
    </div>

    <span class="wrap new">
        <form id="testForm" action="ajax_upload">
            <label>Upload a Picture of Yourself</label>
            <input type="file" id="imageUpload" size="20" />
        <button type="submit" class="button">Save</button>
        </form>
    </span>
</div>
</code>```

Already try in JsFiddle but not working good. Can you guys help what I supposed to do so I can preview the uploaded image with this Jquery?

Thanks a lot!

ContentLicense: CC BY-SA 3.0

Body:
I'm newbie in scripting and try to follow Zurb articles on Image Uploads with 100% Less Suck. Guaranteed. But still can not make it right. On requirement said that I need JQuery and AjaxUpload plugin. So I do make links to files needed:

(Sorry Zurb and others that I use the links, I use the file for educational purpose only. I don't mean anything bad)

This is the script that I follow from Zurb

JQUERY

$(document).ready(function(){
    var thumb = $('img#thumb');

    new AjaxUpload('imageUpload', {
        action: $('form#testForm').attr('action'),
        name: 'image',
        onSubmit: function(file, extension) {
            $('div.preview').addClass('loading');
        },
        onComplete: function(file, response) {
            thumb.load(function(){
                $('div.preview').removeClass('loading');
                thumb.unbind();
            });
            thumb.attr('src', response);
        }
    });
});

CSS

span.wrap { padding: 10px; }
        span.wrap.new { margin-left: 30px; }
        span.wrap button { display: block; margin-top: 10px; }
        span.wrap label { margin-bottom: 5px; }
        div.preview { float: left; width: 100px; height: 100px; border: 2px dotted #CCCCCC; }
        div.preview.loading { background: url(http://www.woningcorporatie-processen.nl/static/modules/sensus/images/loading.gif) no-repeat 39px 40px; }
        div.preview.loading img {display: none; }
        input#imageUpload { width: 400px; }
        span.wrap form { margin: 0; }

HTML

        <form id="testForm" action="ajax_upload">
            Upload a Picture of Yourself
            <input type="file" id="imageUpload" size="20" />
        <button type="submit" class="button">Save</button>
        </form>

Already try in JsFiddle but not working good. Can you guys help what I supposed to do so I can preview the uploaded image with this Jquery?

Thanks a lot!


问:
UI Bug Transforming code from Blazor Server to Blazor WASM
I am currently trying to move a razor file from my Blazor Server project into a Blazor WASM project. However, when I run the razor file on the WASM project, the UI becomes strange as below:

There is always a white space below the background image, which I inserted in the body tag:

```<code><body style="background-image: url('StarBackground.jpg'); background-size:cover;">
...
<body>
</code>```

And below is how I configure the MainLayout.razor:

```<code>@inherits LayoutComponentBase

<PageTitle>Tarotpersonality</PageTitle>

<div>
    <div>
        @Body
    </div>
</div>
</code>```

How can I fix this issue?

In addition, the image sizes seem to change as I run the razor file in Blazor WASM...

Body:
I am currently trying to move a razor file from my Blazor Server project into a Blazor WASM project. However, when I run the razor file on the WASM project, the UI becomes strange as below:

There is always a white space below the background image, which I inserted in the body tag:

...

And below is how I configure the MainLayout.razor:

@inherits LayoutComponentBase

<PageTitle>Tarotpersonality</PageTitle>

        @Body

How can I fix this issue?

In addition, the image sizes seem to change as I run the razor file in Blazor WASM...


问:
How to plot contour plot in Matlab
How to plot like this in MATLAB

I have tried this, but didn't find desired result

```<code>X = 1.2:0.2:3;
Y = 3:0.2:4;

[x, y] = meshgrid(X, Y);
z = x.*y;
contourf(x, y, z, 'ShowText', 'on');

colorbar

title ('Power Efficient Conversion (PEC) Bulk Heterojunction of Solar Cell');
xlabel ('Band Gap [donor]');
ylabel ('LUMO [donor]');
</code>```

Title: How to plot contour plot in Matlab

Body:
How to plot like this in MATLAB

I have tried this, but didn't find desired result

X = 1.2:0.2:3;
Y = 3:0.2:4;

[x, y] = meshgrid(X, Y);
z = x.*y;
contourf(x, y, z, 'ShowText', 'on');

colorbar

title ('Power Efficient Conversion (PEC) Bulk Heterojunction of Solar Cell');
xlabel ('Band Gap [donor]');
ylabel ('LUMO [donor]');


问:
Is module instead of namespace in typescript
I have a single file like 'service.d.ts' that it contains multi namespace and interface, since I use namespace to do it but a lot of articles recommend to use module instead of namespace when I search in google.

namespace version

```<code>export namespace TMS.Master {

        export enum LocationTypeStatus {
                 Active = 0,
                 Disabled = 1
        }
}

export namespace CAS.Master {
        export enum EmployeeStatus {
                 Active = 0,
                 Disable = 1,
                 Pending = 2
        }
        export enum TeamStatus {
                 Active = 0,
                 Disable = 1
        }
     }
</code>```

module version

```<code>export declare module TMS.Master {

        export enum LocationTypeStatus {
                 Active = 0,
                 Disabled = 1
        }
}

export declare module CAS.Master {
        export enum EmployeeStatus {
                 Active = 0,
                 Disable = 1,
                 Pending = 2
        }
        export enum TeamStatus {
                 Active = 0,
                 Disable = 1
        }
     }
</code>```

May I know the module version is correct to use?

Body:
I have a single file like 'service.d.ts' that it contains multi namespace and interface, since I use namespace to do it but a lot of articles recommend to use module instead of namespace when I search in google.

namespace version

export namespace TMS.Master {

        export enum LocationTypeStatus {
                 Active = 0,
                 Disabled = 1
        }
}

export namespace CAS.Master {
        export enum EmployeeStatus {
                 Active = 0,
                 Disable = 1,
                 Pending = 2
        }
        export enum TeamStatus {
                 Active = 0,
                 Disable = 1
        }
     }

module version

export declare module TMS.Master {

        export enum LocationTypeStatus {
                 Active = 0,
                 Disabled = 1
        }
}

export declare module CAS.Master {
        export enum EmployeeStatus {
                 Active = 0,
                 Disable = 1,
                 Pending = 2
        }
        export enum TeamStatus {
                 Active = 0,
                 Disable = 1
        }
     }

May I know the module version is correct to use?


问:
What is the difference between span element and class using pseudo-element?
I want to make a animated button.
If the mouse cursor is placed on the button, the elements in button should be moved to the each place where i set. That's what i want.

HTML Code

```<code>    <div class="ani_button">
        <a href="https://www.google.com">
            <span>Start</span>
        </a>
    </div>
</code>```

CSS code used [.class::after] - Does not work.

```<code>  .ani_button {
    width: 200px;
    font-size: 1.3em;
    background: violet;
    text-align: center;
    margin: auto;
    position: relative;
  }

  .ani_button a {
    display: block;
    padding: 15px;
  }

  .ani_button::after {
    content: "▶";
    position: absolute;
    top: 13px;
    right: 30px;
    font-size: 1.2em;
    opacity: 0;
  }

  .ani_button:hover span {
    margin-right: 20px;
    transition: 0.5s;
  }

  .ani_button:hover .ani_button::after {
    opacity: 1;
    right: 60px;
    transition: 0.5s;
</code>```

CSS code used [span::after] - It works.

```<code>  span::after {
    content: "▶";
    position: absolute;
    top: 13px;
    right: 30px;
    font-size: 1.2em;
    opacity: 0;
  }

  .ani_button:hover span {
    margin-right: 20px;
    transition: 0.5s;
  }

  .ani_button:hover span::after {
    opacity: 1;
    right: 60px;
    transition: 0.5s;
</code>```

What is the difference between this two examples?
I want to know why [.class:hover .class::after] did not work.

Body:
I want to make a animated button.
If the mouse cursor is placed on the button, the elements in button should be moved to the each place where i set. That's what i want.

HTML Code

            Start

CSS code used [.class::after] - Does not work.

  .ani_button {
    width: 200px;
    font-size: 1.3em;
    background: violet;
    text-align: center;
    margin: auto;
    position: relative;
  }

  .ani_button a {
    display: block;
    padding: 15px;
  }

  .ani_button::after {
    content: "▶";
    position: absolute;
    top: 13px;
    right: 30px;
    font-size: 1.2em;
    opacity: 0;
  }

  .ani_button:hover span {
    margin-right: 20px;
    transition: 0.5s;
  }

  .ani_button:hover .ani_button::after {
    opacity: 1;
    right: 60px;
    transition: 0.5s;

CSS code used [span::after] - It works.

  span::after {
    content: "▶";
    position: absolute;
    top: 13px;
    right: 30px;
    font-size: 1.2em;
    opacity: 0;
  }

  .ani_button:hover span {
    margin-right: 20px;
    transition: 0.5s;
  }

  .ani_button:hover span::after {
    opacity: 1;
    right: 60px;
    transition: 0.5s;

What is the difference between this two examples?
I want to know why [.class:hover .class::after] did not work.


问:
Cannot get ApplePay to work on Woocommerce and Square
I'm building a site for a client using WordPress and Woocommerce. They use Square are their payment provider. They want to offer Apple Pay. They tell me they have set up Apple Pay on their Square account (I don't have access to it). I have installed the Square for Woocommerce plugin successfully and it is working on everything but ApplePay. GooglePay comes up and can be used, but ApplePay remains unavailable (the button is in there, but set with display:none and when this CSS is changed to show the button it can be seen but the button still does nothing).

I read that ApplePay will only work on Safari on desktop, and I'm testing with Safari. It still does not work.

On the admin side of WordPress, an alert is shown at the top of the screen that says "Apple Pay is not available with Square - there was a problem with registering your store domain with Square/Apple Pay". It then tells me to look at the log files.

I read that some sort of verification file is required, but the client tells me there is nothing on their Square account to indicate that. They select a button apparently, and no files, merchant ID or anything else is mentioned anywhere.

The log files do not mention ApplyPay at all.

Can anyone please advise a next step? I'm at a loss.


问:
Can't import django-tenants even I installed
I am going to use django-tenants but I couldn't import it even I installed.

```<code>from django_tenants.models import DomainMixin
from django_tenants.utils import get_public_schema_name, schema_context
</code>```

Import "django_tenants.models" could not be resolved.
I can see this error.

Body:
I am going to use django-tenants but I couldn't import it even I installed.

from django_tenants.models import DomainMixin
from django_tenants.utils import get_public_schema_name, schema_context

Import "django_tenants.models" could not be resolved.
I can see this error.


问:
Update list in combo box based on another combo box selection
I made two combo boxes (kategoriCombo and unsurCombo). I want to populate the unsurCombo using a list that i get from parsing api based on the kategoriCombo selection. I saw this post and try it  https://stackoverflow.com/questions/63224359/change-combobox-item-when-another-combobox-item-is-changed-in-pyqt5 but still doesn't work.

My code doesn't get any error but when I change the kategoriCombo, the unsurCombo doesn't update automatically even when i already use currentTextChanged and connect it to a function.

```<code>FORM_CLASS, _ = uic.loadUiType(os.path.join(
    os.path.dirname(__file__), 'kugi_dialog_base.ui'))

urlKategori = "https://kugi.ina-sdi.or.id:8080/kugiapi/featurecatalog"
response = request.urlopen(urlKategori)
dataKategori = json.loads(response.read())

daftarKategori = []
for kategoriList in dataKategori:
    namaKategori = kategoriList.get('name')
    trimmedKategori = namaKategori.strip('@en')
    daftarKategori.append(trimmedKategori)

class kugiDialog(QtWidgets.QDialog, FORM_CLASS):
    def __init__(self, parent=None):
        """Constructor."""
        super(kugiDialog, self).__init__(parent)
        self.setupUi(self)
        self.kategoriCombo.addItems(daftarKategori)
        self.kategoriCombo.currentTextChanged.connect(self.changeKategori)
        self.outputButton.clicked.connect(self.outFolder)
    def changeKategori(self):
        daftarID =[]
        for dataID in dataKategori:
            id = dataID.get('id')
            idKategori = id.strip('@en')
            daftarID.append(idKategori)
        zippedKategori = zip(daftarID, daftarKategori)
        selectedCategory = self.kategoriCombo.currentText()
        idDipilih = []
        for a, b in zippedKategori:
            if b == selectedCategory:
                idDipilih.append(a)
        inputID = (idDipilih[0])
        url = "https://kugi.ina-sdi.or.id:8080/kugiapi/featuretype?fcid="
        response = request.urlopen(url+inputID)
        data = json.loads(response.read())
        daftarUnsur= []
        for listdata in data:
            unsur = listdata.get('typeName')
            namaUnsur = unsur.strip('@en')
            daftarUnsur.append(namaUnsur)
        self.unsurCombo.addItems(daftarUnsur)
</code>```

Body:
I made two combo boxes (kategoriCombo and unsurCombo). I want to populate the unsurCombo using a list that i get from parsing api based on the kategoriCombo selection. I saw this post and try it  https://stackoverflow.com/questions/63224359/change-combobox-item-when-another-combobox-item-is-changed-in-pyqt5 but still doesn't work.

My code doesn't get any error but when I change the kategoriCombo, the unsurCombo doesn't update automatically even when i already use currentTextChanged and connect it to a function.

FORM_CLASS, _ = uic.loadUiType(os.path.join(
    os.path.dirname(__file__), 'kugi_dialog_base.ui'))

urlKategori = "https://kugi.ina-sdi.or.id:8080/kugiapi/featurecatalog"
response = request.urlopen(urlKategori)
dataKategori = json.loads(response.read())

daftarKategori = []
for kategoriList in dataKategori:
    namaKategori = kategoriList.get('name')
    trimmedKategori = namaKategori.strip('@en')
    daftarKategori.append(trimmedKategori)

class kugiDialog(QtWidgets.QDialog, FORM_CLASS):
    def __init__(self, parent=None):
        """Constructor."""
        super(kugiDialog, self).__init__(parent)
        self.setupUi(self)
        self.kategoriCombo.addItems(daftarKategori)
        self.kategoriCombo.currentTextChanged.connect(self.changeKategori)
        self.outputButton.clicked.connect(self.outFolder)
    def changeKategori(self):
        daftarID =[]
        for dataID in dataKategori:
            id = dataID.get('id')
            idKategori = id.strip('@en')
            daftarID.append(idKategori)
        zippedKategori = zip(daftarID, daftarKategori)
        selectedCategory = self.kategoriCombo.currentText()
        idDipilih = []
        for a, b in zippedKategori:
            if b == selectedCategory:
                idDipilih.append(a)
        inputID = (idDipilih[0])
        url = "https://kugi.ina-sdi.or.id:8080/kugiapi/featuretype?fcid="
        response = request.urlopen(url+inputID)
        data = json.loads(response.read())
        daftarUnsur= []
        for listdata in data:
            unsur = listdata.get('typeName')
            namaUnsur = unsur.strip('@en')
            daftarUnsur.append(namaUnsur)
        self.unsurCombo.addItems(daftarUnsur)


问:
Picking up a time-point and its observation based on a certain date
I have a dataset with 3 time-point date (date1,date2,date3) and I have another reference date (ref_date). Each of this date has two  observation value1:value3 and dummy1:dummy3.

```<code>data <- data.frame(ref_date = c("2022-03-05",
                            "2020-10-13",
                            "2025-10-15",
                            "2019-11-22",
                            "2022-12-15",
                            "2021-04-18"),
                   date1 = c("2022-01-05",
                            "2020-03-13",
                            "2025-07-15",
                            "2019-11-22",
                            "2022-04-15",
                            "2021-12-08"),
                   values1 = 1:6,
                   dummy1 = 45:50,
                   date2 = c("2022-02-05",
                            "2020-04-13",
                            "2025-06-15",
                            "2019-12-22",
                            "2022-10-15",
                            "2021-04-08"),
                   values2 = 2:7,
                   dummy2 = 60:65,
                   date3 = c("2022-04-05",
                            "2020-05-13",
                            "2025-08-15",
                            "2019-12-28",
                            "2022-11-15",
                            "2021-04-19"),
                   values3 = 10:15,
                   dummy3 = 70:75)
</code>```

Now I need to use the ref_date as the reference date and select the date and its observations among the three time-points (date1:date3) that is its closest preceding date. In real data the number of observations for each timepoint is ~ 20 NOT 2 so I need to capture them.
The resulting data should look like this. Note the three variables point_date, point_value and point_dummy highlighted in green which is the output I am looking for.
Thanks a lot for the help !

Body:
I have a dataset with 3 time-point date (date1,date2,date3) and I have another reference date (ref_date). Each of this date has two  observation value1:value3 and dummy1:dummy3.

data <- data.frame(ref_date = c("2022-03-05",
                            "2020-10-13",
                            "2025-10-15",
                            "2019-11-22",
                            "2022-12-15",
                            "2021-04-18"),
                   date1 = c("2022-01-05",
                            "2020-03-13",
                            "2025-07-15",
                            "2019-11-22",
                            "2022-04-15",
                            "2021-12-08"),
                   values1 = 1:6,
                   dummy1 = 45:50,
                   date2 = c("2022-02-05",
                            "2020-04-13",
                            "2025-06-15",
                            "2019-12-22",
                            "2022-10-15",
                            "2021-04-08"),
                   values2 = 2:7,
                   dummy2 = 60:65,
                   date3 = c("2022-04-05",
                            "2020-05-13",
                            "2025-08-15",
                            "2019-12-28",
                            "2022-11-15",
                            "2021-04-19"),
                   values3 = 10:15,
                   dummy3 = 70:75)

Now I need to use the ref_date as the reference date and select the date and its observations among the three time-points (date1:date3) that is its closest preceding date. In real data the number of observations for each timepoint is ~ 20 NOT 2 so I need to capture them.
The resulting data should look like this. Note the three variables point_date, point_value and point_dummy highlighted in green which is the output I am looking for.
Thanks a lot for the help !


问:
Exception caught by image resource service.The semaphore timeout period has expired
when I run the program there is an error notification "Exception caught by image resource service.
The semaphore timeout period has expired.
(OS Error: The semaphore timeout period has expired.
, errno = 121), address = www.toyota.astra.co.id, port = 64377)

and open a new window with the file name image.dart

```<code> ImageStreamListener? _imageStreamListener;
  ImageStreamListener _getListener({bool recreateListener = false}) {
    if(_imageStreamListener == null || recreateListener) {
      _lastException = null;
      _lastStack = null;
      _imageStreamListener = ImageStreamListener(
        _handleImageFrame,
        onChunk: widget.loadingBuilder == null ? null : _handleImageChunk,
        onError: widget.errorBuilder != null || kDebugMode
            ? (Object error, StackTrace? stackTrace) {
                setState(() {
                  _lastException = error;
                  _lastStack = stackTrace;
                });
                assert(() {
                  if (widget.errorBuilder == null) {
                    // ignore: only_throw_errors, since we're just proxying the error.
Problem leads to THIS line-> throw error; // Ensures the error message is printed to the console.
                  }
                  return true;
                }());
              }
            : null,
      );
    }
    return _imageStreamListener!;
  }
</code>```

How to fix it Thanks

Body:
when I run the program there is an error notification "Exception caught by image resource service.
The semaphore timeout period has expired.
(OS Error: The semaphore timeout period has expired.
, errno = 121), address = www.toyota.astra.co.id, port = 64377)

and open a new window with the file name image.dart

 ImageStreamListener? _imageStreamListener;
  ImageStreamListener _getListener({bool recreateListener = false}) {
    if(_imageStreamListener == null || recreateListener) {
      _lastException = null;
      _lastStack = null;
      _imageStreamListener = ImageStreamListener(
        _handleImageFrame,
        onChunk: widget.loadingBuilder == null ? null : _handleImageChunk,
        onError: widget.errorBuilder != null || kDebugMode
            ? (Object error, StackTrace? stackTrace) {
                setState(() {
                  _lastException = error;
                  _lastStack = stackTrace;
                });
                assert(() {
                  if (widget.errorBuilder == null) {
                    // ignore: only_throw_errors, since we're just proxying the error.
Problem leads to THIS line-> throw error; // Ensures the error message is printed to the console.
                  }
                  return true;
                }());
              }
            : null,
      );
    }
    return _imageStreamListener!;
  }

How to fix it Thanks


问:
How to custom position tab bar items with the new UITabBarAppearence?
What is the alternate for the below with the new UITabBarAppearence

Before UITabBarAppearence. The below implementation worked fine.

Title Position:

```<code>tabBar.items?[0].titlePositionAdjustment = UIOffset(horizontal: -10 , vertical: -15)
tabBar.items?[1].titlePositionAdjustment = UIOffset(horizontal: -25 , vertical: -15)
tabBar.items?[2].titlePositionAdjustment = UIOffset(horizontal: 25 , vertical: -15)
tabBar.items?[3].titlePositionAdjustment = UIOffset(horizontal: 10 , vertical: -15)
</code>```

Image Position:

```<code>items.forEach { item in
  item.imageInsets = UIEdgeInsets(top: -10, left: 0, bottom: 10, right: 0)
}
</code>```

UITabBarAppearence seems to apply settings to the overall tabBar but couldn't find a way to customise individual items.

Body:
What is the alternate for the below with the new UITabBarAppearence

Before UITabBarAppearence. The below implementation worked fine.

Title Position:

tabBar.items?[0].titlePositionAdjustment = UIOffset(horizontal: -10 , vertical: -15)
tabBar.items?[1].titlePositionAdjustment = UIOffset(horizontal: -25 , vertical: -15)
tabBar.items?[2].titlePositionAdjustment = UIOffset(horizontal: 25 , vertical: -15)
tabBar.items?[3].titlePositionAdjustment = UIOffset(horizontal: 10 , vertical: -15)

Image Position:

items.forEach { item in
  item.imageInsets = UIEdgeInsets(top: -10, left: 0, bottom: 10, right: 0)
}

UITabBarAppearence seems to apply settings to the overall tabBar but couldn't find a way to customise individual items.


问:
Cost Calculator giving wrong calculations
I'm trying to create a cost calculator with 1 dropdown and 2 sliders. Within each choice in the dropdown, it contains 2 different price for each sliders. Both the cost of these 2 sliders add up would give the total cost.

Here is the problem, the cost output is wrong. The output numbers from 2 sliders doesn't add up to the right result.  Can anyone help me with this?

Codepen

```<code>  <style>
    .bubble {
    background: red;
    color: white;
    padding: 4px 12px;
    position: absolute;
    border-radius: 4px;
    left: 50%;
    transform: translateX(-50%);
  }
  .bubble::after {
    content: "";
    position: absolute;
    width: 2px;
    height: 2px;
    background: red;
    top: -1px;
    left: 50%;
  }
  .range-wrap {
  position: relative;
  margin: 0 auto 3rem;
  }
  .range {
  width: 100%;
  }
  </style>
</code>```
```<code>  <h1>WhatsApp Messaging Cost Calculator</h1>

  <!-- Dropdown fields for selecting the message type and network provider -->
  <label for="message-type">Country:</label>
  <select id="message-type" onchange="calculateCost()">
    <option value="text" data="text">US</option>
    <option value="image" data="image">UK</option>
    <option value="audio" data="audio">Europe</option>
  </select>
  <br>

  <!-- Number sliders for selecting the number of messages and size of the message (in KB) -->
  <div class="range-wrap">
  <label for="num-messages">User-initiated conversation rate:</label>
  <input type="range" class="range" min="500" max="10000" value="0" step="10" id="num-messages" oninput="calculateCost(this.value)">
  <output class="bubble"></output>
  <p>Total Cost: $<span id="output2">0.00</span></p>
  </div>
  <br>
  <div class="range-wrap">
  <label for="message-size">Business-initiated conversation rate:</label>
  <input type="range" class="range" min="500" max="10000" value="0" step="10" id="message-size" oninput="calculateCost2(this.value)">
  <output class="bubble"></output>
  <p>Total Cost: $<span id="output3">0.00</span></p>
  </div>
  <br>

  <!-- Live output field for displaying the total cost of the WhatsApp messages -->
  <p>Total Cost: $<span id="cost">0.00</span></p>

</code>```

```<code>  <script>
    function calculateCost(value) {
      // Get the selected values from the dropdown fields and number sliders
      var messageType = (document.getElementById("message-type").value);
      var numMessages = (document.getElementById("num-messages").value);
      var messageSize = (document.getElementById("message-size").value);

      // Set the base cost based on the message type
      var baseCost = 0;
      if (messageType == "text") {
        baseCost = 0.0088;
        baseCost2 = 0.0044;
      } else if (messageType == "image") {
        baseCost = 0.0388;
        baseCost2 = 0.00194;
      } else if (messageType == "audio") {
        baseCost = 0.022;
        baseCost2 = 0.011;
      }

      numMessages = parseInt(numMessages);
      messageSize = parseInt(messageSize);

      // Calculate the total cost based on the base cost, number of messages, and message size
      var messages = numMessages * baseCost;
      var messages2 = messageSize * baseCost2;
      var totalCost = messages + messages2;

      // Update the live output field with the total cost
      document.getElementById("cost").innerHTML = totalCost.toFixed(2);

      // Update the output2 element with a different calculation
      document.getElementById("output2").innerHTML = value * baseCost;
      }

      function calculateCost2(value) {
      // Get the selected values from the dropdown fields and number sliders
      var messageType = (document.getElementById("message-type").value);
      var numMessages = (document.getElementById("num-messages").value);
      var messageSize = (document.getElementById("message-size").value);

      // Set the base cost based on the message type
      var baseCost = 0;
      if (messageType == "text") {
        baseCost = 0.0088;
        baseCost2 = 0.0044;
      } else if (messageType == "image") {
        baseCost = 0.0388;
        baseCost2 = 0.00194;
      } else if (messageType == "audio") {
        baseCost = 0.022;
        baseCost2 = 0.011;
      }

      numMessages = parseInt(numMessages);
      messageSize = parseInt(messageSize);

      // Calculate the total cost based on the base cost, number of messages, and message size
      var messages = numMessages * baseCost;
      var messages2 = messageSize * baseCost2;
      var totalCost = messages + messages2;

      // Update the live output field with the total cost
      document.getElementById("cost").innerHTML = totalCost.toFixed(2);

      // Update the output2 element with a different calculation
      document.getElementById("output3").innerHTML = value * baseCost;
      }

      function calculateCost3(value) {
      // Get the selected values from the dropdown fields and number sliders
      var messageType = (document.getElementById("message-type").value);
      var numMessages = (document.getElementById("num-messages").value);
      var messageSize = (document.getElementById("message-size").value);

      // Set the base cost based on the message type
      var baseCost = 0;
      if (messageType == "text") {
        baseCost = 0.0088;
        baseCost2 = 0.0044;
      } else if (messageType == "image") {
        baseCost = 0.0388;
        baseCost2 = 0.00194;
      } else if (messageType == "audio") {
        baseCost = 0.022;
        baseCost2 = 0.011;
      }

      numMessages = parseInt(numMessages);
      messageSize = parseInt(messageSize);

      // Calculate the total cost based on the base cost, number of messages, and message size
      var totalCost = calculateCost + calculateCost2;

      // Update the live output field with the total cost
      document.getElementById("cost").innerHTML = totalCost.toFixed(2);
      }

  </script>
  <script>
      const allRanges = document.querySelectorAll(".range-wrap");
      allRanges.forEach(wrap => {
        const range = wrap.querySelector(".range");
        const bubble = wrap.querySelector(".bubble");

        range.addEventListener("input", () => {
          setBubble(range, bubble);
        });
        setBubble(range, bubble);
      });

      function setBubble(range, bubble) {
        const val = range.value;
        const min = range.min ? range.min : 0;
        const max = range.max ? range.max : 100;
        const newVal = Number(((val - min) * 100) / (max - min));
        bubble.innerHTML = val;

        // Sorta magic numbers based on size of the native UI thumb
        bubble.style.left = `calc(${newVal}% + (${8 - newVal * 0.15}px))`;
      }
  </script>
</code>```

Body:
I'm trying to create a cost calculator with 1 dropdown and 2 sliders. Within each choice in the dropdown, it contains 2 different price for each sliders. Both the cost of these 2 sliders add up would give the total cost.

Here is the problem, the cost output is wrong. The output numbers from 2 sliders doesn't add up to the right result.  Can anyone help me with this?

Codepen

WhatsApp Messaging Cost Calculator

  Country:
  <select id="message-type" onchange="calculateCost()">
    <option value="text" data="text">US</option>
    <option value="image" data="image">UK</option>
    <option value="audio" data="audio">Europe</option>
  </select>

  User-initiated conversation rate:
  <input type="range" class="range" min="500" max="10000" value="0" step="10" id="num-messages" oninput="calculateCost(this.value)">
  <output class="bubble"></output>

Total Cost: $0.00

  Business-initiated conversation rate:
  <input type="range" class="range" min="500" max="10000" value="0" step="10" id="message-size" oninput="calculateCost2(this.value)">
  <output class="bubble"></output>

Total Cost: $0.00

Total Cost: $0.00


问:
Where can I find the mp3plugin.jar to work with mp3 files in java?
I want to create a mp3 player in Java. Therefore it needs JMF and mp3plugin libraries. Because, by default, Java does not support mp3 format. I can't find the mp3plugin anywhere.

https://www.oracle.com/java/technologies/javase/jmf-mp3-plugin.html

I found this link, but there is not any jar file that can be downloaded. Does anyone know where can I download the jar file, or does anyone have the library?

I searched on google for it. But I didn't get it, even from here. I want a way to develop a mp3 audio player  in Java SE. It is better if I got the mp3plugin library.


问:
Android How to listener the soft keyboard key event for key 0 - 9 or decimal? Without Long Press
I want to find out anyway to handle the keyevent for soft keyboard. Example I click keyboard 0 - 9 now. I will only get the listen event when it is long click.</p>


问:
How do I use the hue argument in the plot fuctions for counting the specific number of observation of a label?
I basically have two problems which are very simple yet I'm stuck as I'm not use to work with stadistics in python.

The first problems is that I have a dataset with a large number of rows and a few labels, and I'm interested in two of them. I want to plot a Bar Chart (in any of the two ways seem below) that plots me the number of rows that satifies belonging to a particular class of the first label divided by the class of the second label. For example if in the Group A there's 160 rows and each of them 40 if also for Series 1, I want it plotted like below (there's a link in an image)

```<code>         Group  Series
0   Group A Series 2
1   Group B Series 1
2   Group B Series 5
3   Group A Series 4
0   Group A Series 1
1   Group B Series 3
2   Group B Series 3
3   Group A Series 2
</code>```

Image

The second problems is that I would also like to know if is there any fuction that given two labels, for each class of the first label, tells me the percentaje of each of labels of the second column. Like in the second question but instead of visually I want it numerically. The output would be something like

```<code>Group A : 24% Series 1, 17% Series 2, 11% Series 3...
Group B: 27% Series 1, 13% Series 2, 10% Series 3...
</code>```

I've tried the plotting with the hue argument but I don't know how do I do for counting the number of observations.

Body:
I basically have two problems which are very simple yet I'm stuck as I'm not use to work with stadistics in python.

The first problems is that I have a dataset with a large number of rows and a few labels, and I'm interested in two of them. I want to plot a Bar Chart (in any of the two ways seem below) that plots me the number of rows that satifies belonging to a particular class of the first label divided by the class of the second label. For example if in the Group A there's 160 rows and each of them 40 if also for Series 1, I want it plotted like below (there's a link in an image)

         Group  Series
0   Group A Series 2
1   Group B Series 1
2   Group B Series 5
3   Group A Series 4
0   Group A Series 1
1   Group B Series 3
2   Group B Series 3
3   Group A Series 2

Image

The second problems is that I would also like to know if is there any fuction that given two labels, for each class of the first label, tells me the percentaje of each of labels of the second column. Like in the second question but instead of visually I want it numerically. The output would be something like

Group A : 24% Series 1, 17% Series 2, 11% Series 3...
Group B: 27% Series 1, 13% Series 2, 10% Series 3...

I've tried the plotting with the hue argument but I don't know how do I do for counting the number of observations.


问:
Image wont load or sync in embeds
So I have an image link Im trying to use in a javascipt canvas hosted on imgur, and I have the actual image link, i.imigur and ending in .png, but the image doesnt load when I try to send it into an embed. I cant tell whats wrong with this, since it just seems like the files arent being edited or synced</p>
```<code>function setUpBoard()
{
    const canvas = createCanvas(780, 780, "png")
    const ctx = canvas.getContext('2d')

    loadImage(`https://i.imgur.com/r1aY7mX.png`).then((image) => {ctx.drawImage(image, 0, 0, canvas.width, canvas.height)})
    fs.readdir(`src/commands/PNGs`, (err, files) => {
        files.forEach(file => {
        if (file.toString().includes("BlackBishop"))
            {
                // Loads black bishop on the right side and then the left side
                loadImage('https://i.imgur.com/3JYKPWT.png')
                    .then((image) => {
                        ctx.drawImage(image, 0, 0)
                        ctx.drawImage(image, 0, 4)
                    })
            }
        })
    })

    const buffer = canvas.toBuffer(`image/png`)
    fs.writeFileSync('./src/commands/PNGs/StartBoard.png', buffer)

    const file = new AttachmentBuilder(buffer, { name: './src/commands/PNGs/StartBoard.png' })

    var embed = new EmbedBuilder()
        .setTitle(`${member.user.username}'s move`)

    message.reply({ embeds: [embed], files: [file] })
}
</code>```

Title: Image wont load or sync in embeds

Body:
So I have an image link Im trying to use in a javascipt canvas hosted on imgur, and I have the actual image link, i.imigur and ending in .png, but the image doesnt load when I try to send it into an embed. I cant tell whats wrong with this, since it just seems like the files arent being edited or synced

function setUpBoard()
{
    const canvas = createCanvas(780, 780, "png")
    const ctx = canvas.getContext('2d')

    loadImage(`https://i.imgur.com/r1aY7mX.png`).then((image) => {ctx.drawImage(image, 0, 0, canvas.width, canvas.height)})
    fs.readdir(`src/commands/PNGs`, (err, files) => {
        files.forEach(file => {
        if (file.toString().includes("BlackBishop"))
            {
                // Loads black bishop on the right side and then the left side
                loadImage('https://i.imgur.com/3JYKPWT.png')
                    .then((image) => {
                        ctx.drawImage(image, 0, 0)
                        ctx.drawImage(image, 0, 4)
                    })
            }
        })
    })

    const buffer = canvas.toBuffer(`image/png`)
    fs.writeFileSync('./src/commands/PNGs/StartBoard.png', buffer)

    const file = new AttachmentBuilder(buffer, { name: './src/commands/PNGs/StartBoard.png' })

    var embed = new EmbedBuilder()
        .setTitle(`${member.user.username}'s move`)

    message.reply({ embeds: [embed], files: [file] })
}


问:
How can i use Cells.EntireColumn.Autofit in all Sheets?
```<code>Sub teste()

    Dim ws As Worksheet

    For Each ws In ThisWorkbook.Worksheets
        ws.Activate
        Cells.EntireColumn.AutoFit
    Next ws

End Sub
</code>```


问:
There is no 'VBE6EXT. OLB' in the excel provided by the computer
The Excel provided with the computer does not have 'VBE6EXT. OLB', which makes it impossible to use Visual Basic

I tried to reinstall Excel, but because of the laptop model problem, I could only install it through the files of the computer manufacturer, and their files did not have this function


问:
.NET on Fedora Linux, Version 4
I'm a .NET noob so forgive me if my question is leaving anything out.

I'm trying to build a .NET application on Linux. I have dotnet version 5.0.408 installed, and have also tried this with dotnet 6. I recieve this error when trying dotnet build linkto.csproj --runtime fedora.37-x86

error MSB3644: The reference assemblies for .NETFramework,Version=v4.8 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks

It doesn't seem possible to install the dotnet SDK for 4.8 on Linux, as it isn't listed as downloadable here: https://dotnet.microsoft.com/en-us/download/dotnet

Title: .NET on Fedora Linux, Version 4


问:
`dotnet user-secrets` error "Could not load the MSBuild project" only for a specific user account

Details

dotnet user-secrets clear, list, remove,  and set, all return "Could not load the MSBuild project" for a specific user account, but work fine with another user account and the Administrator.

dotnet user-secrets init successfully adds a UserSecretsId property to the project file.

The affected account is a local Windows account, lowercase with no spaces.

Troubleshooting

I uninstalled and reinstalled the .NET SDK from the Visual Studio installer.

I tried troubleshooting permissions for the account for the following paths and sub-directories:

The project directory

%AppData%\Microsoft\UserSecrets\

%ProgramFiles%\dotnet\

%ProgramFiles(x86)%\dotnet\

%UserProfile%\.dotnet\

dotnet --info:

```<code>.NET SDK:
 Version:   7.0.101
 Commit:    bb24aafa11

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19044
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.101\

Host:
  Version:      7.0.1
  Architecture: x64
  Commit:       97203d38ba

.NET SDKs installed:
  7.0.101 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found
</code>```

Questions

Is there a way I can track which files and directories are accessed by dotnet user-secrets so I can further troubleshoot a potential permissions issue?

Is it possible to wipe any user settings or config data involving the .NET SDK and do a clean install?

Body:
Details

dotnet user-secrets clear, list, remove,  and set, all return "Could not load the MSBuild project" for a specific user account, but work fine with another user account and the Administrator.

dotnet user-secrets init successfully adds a UserSecretsId property to the project file.

The affected account is a local Windows account, lowercase with no spaces.

Troubleshooting

I uninstalled and reinstalled the .NET SDK from the Visual Studio installer.

I tried troubleshooting permissions for the account for the following paths and sub-directories:

The project directory

%AppData%\Microsoft\UserSecrets\

%ProgramFiles%\dotnet\

%ProgramFiles(x86)%\dotnet\

%UserProfile%\.dotnet\

dotnet --info:

.NET SDK:
 Version:   7.0.101
 Commit:    bb24aafa11

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19044
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.101\

Host:
  Version:      7.0.1
  Architecture: x64
  Commit:       97203d38ba

.NET SDKs installed:
  7.0.101 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Questions

Is there a way I can track which files and directories are accessed by dotnet user-secrets so I can further troubleshoot a potential permissions issue?

Is it possible to wipe any user settings or config data involving the .NET SDK and do a clean install?


问:
pytest addopts ignore certain source file
I am using pytest for unit test and generating code coverage.

I have the following pytest.ini file:

```<code>[pytest]
xfail_strict=true
addopts =
    --cov=config .coveragerc
    --cov=./lib/project/model
    --cov=./lib/project/utility
    --ignore-./lib/project/utility/hello_world.py
    --cov-report=xml:./test-result/coverage.xml
    --cov-report=html:./test-result/
    --html=./test-result/report.html
    --junit-xml=./test-results/pytest.xml
    -p pytest_cov -p pytest_mock -p pytest_html --vv
</code>```

I am trying to ignore file ./lib/project/utility/hello_world.py from the coverage report. However  --ignore-./lib/project/utility/hello_world.py has no effect on coverage report.

How do I ignore certain files or directories from the coverage report in this case?

Body:
I am using pytest for unit test and generating code coverage.

I have the following pytest.ini file:

[pytest]
xfail_strict=true
addopts =
    --cov=config .coveragerc
    --cov=./lib/project/model
    --cov=./lib/project/utility
    --ignore-./lib/project/utility/hello_world.py
    --cov-report=xml:./test-result/coverage.xml
    --cov-report=html:./test-result/
    --html=./test-result/report.html
    --junit-xml=./test-results/pytest.xml
    -p pytest_cov -p pytest_mock -p pytest_html --vv

I am trying to ignore file ./lib/project/utility/hello_world.py from the coverage report. However  --ignore-./lib/project/utility/hello_world.py has no effect on coverage report.

How do I ignore certain files or directories from the coverage report in this case?


问:
Twitter card image won't show up
Description of issue: My card image refuses to show up no matter what I do. All the other meta tag elements like url, title and description show up in the compose tweet window and on the timeline when I post a tweet.

URL affected: Here’s the url that’s having issues: https://dasaweb.co/.

Troubleshooting steps attempted: I’ve done all the troubleshooting recommended at Card Debugging and the image still doesn’t show up:

My metatags are formatted properly and show up when I view page
source. Curl requests output also show my meta tags.

As far as I can see, my host doesn’t block Twitter’s IP range as all
the other meta tag elements appear in the card.

The image file is accessible via the absolute path provided in the meta tag.

The Card Validator shows the following in the log:

```<code>INFO:  Page fetched successfully
INFO:  17 metatags were found
INFO:  twitter:card = summary_large_image tag found
INFO:  Card loaded successfully
</code>```

I tested hosting my image file on both http and https pages just in
the event that contributes to the error in some way.

The image conforms to the size guidelines. It’s 1200pxx600px, 2:1
aspect ratio and 336.67kb.

It seems to me like I’m doing everything right. I’m not sure what the issue is.

Title: Twitter card image won't show up

Body:
Description of issue: My card image refuses to show up no matter what I do. All the other meta tag elements like url, title and description show up in the compose tweet window and on the timeline when I post a tweet.

URL affected: Here’s the url that’s having issues: https://dasaweb.co/.

Troubleshooting steps attempted: I’ve done all the troubleshooting recommended at Card Debugging and the image still doesn’t show up:

My metatags are formatted properly and show up when I view page
source. Curl requests output also show my meta tags.

As far as I can see, my host doesn’t block Twitter’s IP range as all
the other meta tag elements appear in the card.

The image file is accessible via the absolute path provided in the meta tag.

The Card Validator shows the following in the log:

INFO:  Page fetched successfully
INFO:  17 metatags were found
INFO:  twitter:card = summary_large_image tag found
INFO:  Card loaded successfully

I tested hosting my image file on both http and https pages just in
the event that contributes to the error in some way.

The image conforms to the size guidelines. It’s 1200pxx600px, 2:1
aspect ratio and 336.67kb.

It seems to me like I’m doing everything right. I’m not sure what the issue is.


问:
MoveTo in Crossterm is clearing my output
When using the crossterm library with this code:

fn draw_box(stdout: &mut Stdout, x: u16, y: u16) -> Result<()> {
    let size = 5;

    let outline = (x..x + size)
        .map(|i| (i, y))
        .chain((y + 1..y + size - 1).map(|i| (x + size - 1, i)))
        .chain((y + 1..y + size - 1).map(|i| (x, i)))
        .chain((x..x + size).map(|i| (i, y + size - 1)))
        .collect::<Vec<_>>();

    for (a, b) in outline {
        stdout
            .queue(cursor::MoveTo(a, b))?
            .queue(style::Print("x"))?;
    }

    stdout.flush()?;

    stdout
        .queue(cursor::MoveTo(x + 2, y + 2))?
        .queue(style::Print("o"))?;

    stdout.flush()?;

    Ok(())
}
```
<p>The last draw command clears the rest of the output to give this:</p>
<pre class="lang-bash prettyprint-override"><code>xxxxx
x   x
x o%
</code>```

If I remove that command I get the full box:

xxxxx
x   x
x   x
x   x
xxxxx%
```

How can I draw the box and then draw the circle inside of the box?

Body:
When using the crossterm library with this code:

fn draw_box(stdout: &mut Stdout, x: u16, y: u16) -> Result<()> {
    let size = 5;

    let outline = (x..x + size)
        .map(|i| (i, y))
        .chain((y + 1..y + size - 1).map(|i| (x + size - 1, i)))
        .chain((y + 1..y + size - 1).map(|i| (x, i)))
        .chain((x..x + size).map(|i| (i, y + size - 1)))
        .collect::<Vec<_>>();

    for (a, b) in outline {
        stdout
            .queue(cursor::MoveTo(a, b))?
            .queue(style::Print("x"))?;
    }

    stdout.flush()?;

    stdout
        .queue(cursor::MoveTo(x + 2, y + 2))?
        .queue(style::Print("o"))?;

    stdout.flush()?;

    Ok(())
}

The last draw command clears the rest of the output to give this:

xxxxx
x   x
x o%

If I remove that command I get the full box:

xxxxx
x   x
x   x
x   x
xxxxx%

How can I draw the box and then draw the circle inside of the box?


问:
Possible to POST to multiple tables in Postrgres using a single Sequelize Model?
I need to post form data where each piece of data ends up on different tables in Postgres. I have built out a single model with many relationships that manages one of my other forms, but within that model I do have all of my other tables defined. So can I use that same model to insert data into multiple tables or do I have to create a separate model file for each table? I am terribly confused.

My GitHub:
https://github.com/Younion/new-app

My Form has these four inputs. All of which need to go on four different tables:

Manufacturer - Should post to Manufacturers below, in the model
Sauce Name - Should post to HotSauces below, in the model
Location - Should post to Located below, in the model
Flavor Notes - Should post to FlavorNotes below, in the model

Note that all other tables I've defined below using Sequelize are used for other purposes.
Also, note that I AM able to post data to just one table at a time using this model. Just not multiple.

My Model:

```<code>const { DataTypes } = require('sequelize');

module.exports = function(sequelize) {
    const Located = sequelize.define('located', {name: {type: DataTypes.STRING, allowNull: false}},     {freezeTableName: true,});
    const Viscosity = sequelize.define('viscosity', {name: {type: DataTypes.STRING, allowNull: false}}, {freezeTableName: true,});
    const HeatSources = sequelize.define('heat_sources', {name: {type: DataTypes.STRING, allowNull: false}}, {freezeTableName: true,});
    const FlavorNotes = sequelize.define('flavor_notes', {name: {type: DataTypes.STRING, allowNull: false}}, {freezeTableName: true,});
    const Manufacturers = sequelize.define('manufacturers', {name: {type: DataTypes.STRING, allowNull: false}}, {freezeTableName: true,}); // post
    const HotSauces = sequelize.define('hot_sauces', {name: {type: DataTypes.STRING, allowNull: false}}, {freezeTableName: true,}); // post
    const TastingForm = sequelize.define('tasting_form',
        {
            overall_rating: {
                type: DataTypes.INTEGER,
                allowNull: false,
                validate: {
                    max: 5,
                    min: 0
                    }
                },
            spiciness: {
                type: DataTypes.INTEGER,
                allowNull: false,
                validate: {
                    max: 10,
                    min: 0
                    }
                },
            presentation: {
                type: DataTypes.INTEGER,
                validate: {
                    max: 5,
                    min: 0
                    }
                },
            lovedit: {
                type: DataTypes.BOOLEAN
                },
            taster_notes: {
                type: DataTypes.TEXT,
                }
        },
        {freezeTableName: true,});

    // Associations
        // Location ---> Manufacturers
        // Manufacturer has one location from a list of Locations
        Located.hasMany(Manufacturers);
        Manufacturers.belongsTo(Located);

        // Manufacturers ---> Hot Sauces
        // Hot sauces has one manufacturer from a list of manufacturers, and
        // Hot sauces has many heat sources from a list a of heat sources.
        Manufacturers.hasMany(HotSauces);
        HotSauces.belongsTo(Manufacturers);

        // Hot sauces ---> Heat Sources
        // Hot sauces has many heat sources from a list of heat sources.
        HeatSources.belongsToMany(HotSauces, {through: 'hot_sauces_heat_sources'});

        // Tasting Form ---> Viscocity
        // One Tasting Form has one viscocity from a list of viscocity
        Viscosity.hasMany(TastingForm);
        TastingForm.belongsTo(Viscosity);

        // Tasting Form ---> Hot Sauces
        // One Tasting Form has one Hot Sauce from a list of Hot Sauces
        HotSauces.hasMany(TastingForm);
        TastingForm.belongsTo(HotSauces);

        // Tasting Form ---> Flavor Notes
        // Tasting Form has many flavor notes from a list of flavor notes
        FlavorNotes.belongsToMany(TastingForm, {through: 'tasting_form_flavor_notes'});

    return Manufacturers;
};
</code>```
```<code>app.post('/', async (req, res) => {
    await Jyh.create({  // .create is a Sequelize method
        manufacturer_name: req.body.Manufacturer,
        hot_sauce_name: req.body.SauceName
        // hotSauceId: req.body.hotSauceId,
        // presentation: req.body.presentation,
        // viscosityId: req.body.viscosityId,
        // spiciness: req.body.spiciness,
        // Flavor_Notes: req.body.Flavor_Notes,
        // overall_rating: req.body.overall_rating,
        // lovedit: req.body.lovedit,
        // taster_notes: req.body.taster_notes
    }).then(() => {
        console.log('req.body: ', req.body);
    }).catch((err) => {
        console.log(err);
    });
});
</code>```

I've tried to manipulate the model and post requests to do as I wish to no avail.

Body:
I need to post form data where each piece of data ends up on different tables in Postgres. I have built out a single model with many relationships that manages one of my other forms, but within that model I do have all of my other tables defined. So can I use that same model to insert data into multiple tables or do I have to create a separate model file for each table? I am terribly confused.

My GitHub:
https://github.com/Younion/new-app

My Form has these four inputs. All of which need to go on four different tables:

Manufacturer - Should post to Manufacturers below, in the model
Sauce Name - Should post to HotSauces below, in the model
Location - Should post to Located below, in the model
Flavor Notes - Should post to FlavorNotes below, in the model

Note that all other tables I've defined below using Sequelize are used for other purposes.
Also, note that I AM able to post data to just one table at a time using this model. Just not multiple.

My Model:

const { DataTypes } = require('sequelize');

module.exports = function(sequelize) {
    const Located = sequelize.define('located', {name: {type: DataTypes.STRING, allowNull: false}},     {freezeTableName: true,});
    const Viscosity = sequelize.define('viscosity', {name: {type: DataTypes.STRING, allowNull: false}}, {freezeTableName: true,});
    const HeatSources = sequelize.define('heat_sources', {name: {type: DataTypes.STRING, allowNull: false}}, {freezeTableName: true,});
    const FlavorNotes = sequelize.define('flavor_notes', {name: {type: DataTypes.STRING, allowNull: false}}, {freezeTableName: true,});
    const Manufacturers = sequelize.define('manufacturers', {name: {type: DataTypes.STRING, allowNull: false}}, {freezeTableName: true,}); // post
    const HotSauces = sequelize.define('hot_sauces', {name: {type: DataTypes.STRING, allowNull: false}}, {freezeTableName: true,}); // post
    const TastingForm = sequelize.define('tasting_form',
        {
            overall_rating: {
                type: DataTypes.INTEGER,
                allowNull: false,
                validate: {
                    max: 5,
                    min: 0
                    }
                },
            spiciness: {
                type: DataTypes.INTEGER,
                allowNull: false,
                validate: {
                    max: 10,
                    min: 0
                    }
                },
            presentation: {
                type: DataTypes.INTEGER,
                validate: {
                    max: 5,
                    min: 0
                    }
                },
            lovedit: {
                type: DataTypes.BOOLEAN
                },
            taster_notes: {
                type: DataTypes.TEXT,
                }
        },
        {freezeTableName: true,});

    // Associations
        // Location ---> Manufacturers
        // Manufacturer has one location from a list of Locations
        Located.hasMany(Manufacturers);
        Manufacturers.belongsTo(Located);

        // Manufacturers ---> Hot Sauces
        // Hot sauces has one manufacturer from a list of manufacturers, and
        // Hot sauces has many heat sources from a list a of heat sources.
        Manufacturers.hasMany(HotSauces);
        HotSauces.belongsTo(Manufacturers);

        // Hot sauces ---> Heat Sources
        // Hot sauces has many heat sources from a list of heat sources.
        HeatSources.belongsToMany(HotSauces, {through: 'hot_sauces_heat_sources'});

        // Tasting Form ---> Viscocity
        // One Tasting Form has one viscocity from a list of viscocity
        Viscosity.hasMany(TastingForm);
        TastingForm.belongsTo(Viscosity);

        // Tasting Form ---> Hot Sauces
        // One Tasting Form has one Hot Sauce from a list of Hot Sauces
        HotSauces.hasMany(TastingForm);
        TastingForm.belongsTo(HotSauces);

        // Tasting Form ---> Flavor Notes
        // Tasting Form has many flavor notes from a list of flavor notes
        FlavorNotes.belongsToMany(TastingForm, {through: 'tasting_form_flavor_notes'});

    return Manufacturers;
};

app.post('/', async (req, res) => {
    await Jyh.create({  // .create is a Sequelize method
        manufacturer_name: req.body.Manufacturer,
        hot_sauce_name: req.body.SauceName
        // hotSauceId: req.body.hotSauceId,
        // presentation: req.body.presentation,
        // viscosityId: req.body.viscosityId,
        // spiciness: req.body.spiciness,
        // Flavor_Notes: req.body.Flavor_Notes,
        // overall_rating: req.body.overall_rating,
        // lovedit: req.body.lovedit,
        // taster_notes: req.body.taster_notes
    }).then(() => {
        console.log('req.body: ', req.body);
    }).catch((err) => {
        console.log(err);
    });
});

I've tried to manipulate the model and post requests to do as I wish to no avail.


问:
Assigning stm topic model & LDA models to original dataset and renaming topic names
I'm using the powerful Quanteda library and I wonder which is the best way to assign a topic model created using a STM model. In other words, once I have found my n topics using the stm fun over a dfm object, how do I create a data frame with each docid and its corresponding topic?

Let's say I have the following example:

```<code> dfm_to_model <- tokens(head(data_corpus_inaugural, 50),
              remove_punct = TRUE) %>%
              tokens_remove(stopwords("en")) %>%
              dfm() %>%
              dfm_trim(min_termfreq = 0.3, termfreq_type = "quantile",
              min_docfreq = 0.05, docfreq_type = "prop")

stm_topic = stm(dfm_to_model, K = 5, max.em.its = 150, control=list(alpha=1))
stm_topic

plot(stm_topic, type="summary")
</code>```

Image:

Now let's make a LDA example:

```<code>tmod_lda <- textmodel_lda(dfm_to_model, k = 5) # LDA MODEL

> seededlda::terms(tmod_lda, 10)
      topic1         topic2   topic3      topic4       topic5
 [1,] "government"   "us"     "great"     "government" "must"
 [2,] "constitution" "let"    "every"     "upon"       "world"
 [3,] "union"        "people" "country"   "people"     "can"
 [4,] "power"        "world"  "public"    "laws"       "nations"
 [5,] "states"       "time"   "united"    "must"       "justice"
 [6,] "people"       "now"    "states"    "shall"      "life"
 [7,] "can"          "new"    "citizens"  "congress"   "peace"
 [8,] "upon"         "one"    "may"       "can"        "men"
 [9,] "one"          "shall"  "war"       "law"        "nation"
[10,] "may"          "can"    "interests" "american"   "upon"
>
</code>```

But how do I know which topic belongs to which document id? Also, is there a way to rename the labels of the topics such as topic 1: "Leadership" for both the stm and the LDA model?

Body:
I'm using the powerful Quanteda library and I wonder which is the best way to assign a topic model created using a STM model. In other words, once I have found my n topics using the stm fun over a dfm object, how do I create a data frame with each docid and its corresponding topic?

Let's say I have the following example:

 dfm_to_model <- tokens(head(data_corpus_inaugural, 50),
              remove_punct = TRUE) %>%
              tokens_remove(stopwords("en")) %>%
              dfm() %>%
              dfm_trim(min_termfreq = 0.3, termfreq_type = "quantile",
              min_docfreq = 0.05, docfreq_type = "prop")

stm_topic = stm(dfm_to_model, K = 5, max.em.its = 150, control=list(alpha=1))
stm_topic

plot(stm_topic, type="summary")

Image:

Now let's make a LDA example:

tmod_lda <- textmodel_lda(dfm_to_model, k = 5) # LDA MODEL

> seededlda::terms(tmod_lda, 10)
      topic1         topic2   topic3      topic4       topic5
 [1,] "government"   "us"     "great"     "government" "must"
 [2,] "constitution" "let"    "every"     "upon"       "world"
 [3,] "union"        "people" "country"   "people"     "can"
 [4,] "power"        "world"  "public"    "laws"       "nations"
 [5,] "states"       "time"   "united"    "must"       "justice"
 [6,] "people"       "now"    "states"    "shall"      "life"
 [7,] "can"          "new"    "citizens"  "congress"   "peace"
 [8,] "upon"         "one"    "may"       "can"        "men"
 [9,] "one"          "shall"  "war"       "law"        "nation"
[10,] "may"          "can"    "interests" "american"   "upon"
>

But how do I know which topic belongs to which document id? Also, is there a way to rename the labels of the topics such as topic 1: "Leadership" for both the stm and the LDA model?


问:
Problem to get value from a range dynamically and set this value to other range of another sheet
Actually i have two sheet one is master sheet and other is data sheet. i want to input data in every 5th row and starting with 4th row(i.e 4, 9, 14, ...etc) in the Master sheet("1EzemDPlSwWo5SJsJkePbPUlrOh-BoCa9svu9i85uZfQ"). Now i want these data to Data sheet("1hdbT-g2gDdLVng6jMieOULgjWlPlRckl8sUS_UGJroQ") in every 5th row starting with 7th row.</p>
```<code>function myFunction() {
var An = SpreadsheetApp.openById("1EzemDPlSwWo5SJsJkePbPUlrOh-BoCa9svu9i85uZfQ");
 var GetSa1 =An.getSheetByName("CLASS I  FORMATIVE(A.N)");
var Fs = SpreadsheetApp.openById("1hdbT-g2gDdLVng6jMieOULgjWlPlRckl8sUS_UGJroQ");
 var GetFh1 =Fs.getSheetByName("REPORT CARD FOR ALL CLASS 2023");

 var Ps1 =[];
for(var i = 4;i<=44;i=i+5){
  Ps1=(GetSa1.getRange("O"+[i]).getValue());
Logger.log( Ps1);
for(var j=7;j<=44;j=j+5){
 GetFh1.getRange("R"+[j]).setValue(Ps1);

      }
    }
}
</code>```

Body:
Actually i have two sheet one is master sheet and other is data sheet. i want to input data in every 5th row and starting with 4th row(i.e 4, 9, 14, ...etc) in the Master sheet("1EzemDPlSwWo5SJsJkePbPUlrOh-BoCa9svu9i85uZfQ"). Now i want these data to Data sheet("1hdbT-g2gDdLVng6jMieOULgjWlPlRckl8sUS_UGJroQ") in every 5th row starting with 7th row.

function myFunction() {
var An = SpreadsheetApp.openById("1EzemDPlSwWo5SJsJkePbPUlrOh-BoCa9svu9i85uZfQ");
 var GetSa1 =An.getSheetByName("CLASS I  FORMATIVE(A.N)");
var Fs = SpreadsheetApp.openById("1hdbT-g2gDdLVng6jMieOULgjWlPlRckl8sUS_UGJroQ");
 var GetFh1 =Fs.getSheetByName("REPORT CARD FOR ALL CLASS 2023");

 var Ps1 =[];
for(var i = 4;i<=44;i=i+5){
  Ps1=(GetSa1.getRange("O"+[i]).getValue());
Logger.log( Ps1);
for(var j=7;j<=44;j=j+5){
 GetFh1.getRange("R"+[j]).setValue(Ps1);

      }
    }
}