Filter Dropdown based on a RadioButton

Hi, guys
I need to show the apps according to the selected OS: Android or IOS.
The OS is chosen by a Radio Button, and after that it would need to filter the dropdown with the respective OS apps. I know this can be done by typescript, which is where I'm trying, but to no avail so far.
The main question, besides how to make this filter, is how it would retrieve the information, relating app and OS, since they are in a SQL table.
Any suggestions are welcome. Thanks.

Hi @leovamos ,
can you show a screenshot / mockup what you are trying to achieve so we can better understand?
Is the dropdown within a Serenity form (an official form field) which has a lookup editor on it?
Tell us more...
With kind regards,
John

Hi @JohnRanger
Thanks for answer
Here is my Dialog for the problem. The code is just an attempt I had but it doesn't really works. I get it from another site just to try.
`@Serenity.Decorators.registerClass()
export class AppTrustDialog extends Serenity.EntityDialog<AppTrustRow, any> {

    protected getFormKey() { return AppTrustForm.formKey; }
    protected getIdProperty() { return AppTrustRow.idProperty; }
    protected getLocalTextPrefix() { return AppTrustRow.localTextPrefix; }
    protected getService() { return AppTrustService.baseUrl; }

`       protected form = new AppTrustForm(this.idPrefix);
    protected getToolbarButtons(): Serenity.ToolButton[] {
        $("#Serenity_RadioButtonEditor10_10").change(function () {
            var filterValue = $(this).val();
            var row = $('.row');

            row.hide()
            row.each(function (i, el) {
                if ($(el).attr('data-type') == filterValue) {
                    $(el).show();
                }
            })

        });*/

        var buttons = super.getToolbarButtons();
        return buttons;
        //Serenity_RadioButtonEditor10_10
        //Serenity_RadioButtonEditor10_11
        //s2id_DashboardSMICv2_Smic_AppTrustDialog7_AppId1
        //s2id_DashboardSMICv2_Smic_AppTrustDialog7_AppId2
    }
}

The last four lines are the IDs of the components Radio Button and the Dropdowns in HTML. I want to get the value of the radio button, and based on it, change the shown values in both dropdowns.
The two Radio Buttons have values like 10 and 11, each one representing an OS (Android for 10, iOS for 11), and after clicking on one of them, the list of values in both dropdowns are changed according to the OS you choose, showing apps from that OS.
The main problem, like I said, as well as how to assemble the JQuery code, is how to search for data in SQL Server by JQuery, for me it seems kind of impossible. I can even imagine the query: "SELECT * FROM Apps WHERE Platform=x", where x is the value of the chosen platform and 'Apps' would be the table which contains all the apps.
Sorry if there's some error, thanks in advance
Leonardo

Hi @leovamos ,
ah - if the main problem here is how to fetch data on the client-side (the whole xyzDialog.ts is client-side) over from the server side (SQL and xyzEndpoint.cs) - then look at this wiki: https://github.com/volkanceylan/Serenity/wiki/BBB:-On-client-side,-fetching-a-value-from-server-side-out-of-database
Here I explain how to fetch data from server-side to client-side.
But I would be very interested in your RadioButtonEditor code :-) As this is really an interesting feature.
Hope, above helps a bit.
Otherwise, let me know :-)
With kind regards,
John

@leovamos ,
I am unfortunately not good in converting code within my mind into a visualization.
Please use MS paint or so to quickly draw a mockup on what you want to achieve - with comments beside the form fields (what should happen when in the fields a selection is made).
If I understand correct, you want to fill the 2nd dropdown field based on a choice in 1st dropdown, correct?
For this the best way is to fill the 1st form field via a lookup editor (your OS choice).
Assign the EmptyLookupEditor (from dfaruque's Serenity.Extra - a repository here on Github) so that the 2nd dropdown stays empty.
Aand then in the onChange-Event of the 1st dropdown do a query via xyzService on the client side (by passing the just selected value form the 1st dropdown) to the server side (via a custom written endpoint (an additional entry in the xyzEndpoint.cs within the entity which will deliver the desired data for the 2nd dropdown) and the matching sql query in xyzRepository.ts.
The Query should only deliver a list of ids with the corresponding texts. This list is returned to the xyzEndpoint and from there over to the client-side.
And then do a foreach on the returned data and add the items to the 2nd dropdown (a jquery select2 widget).
Hope this gives you an overview on what to do.
With kind regards,
John

Hi @JohnRanger, here is basically a screenshot of my page with the problem:

Hey @JohnRanger, I just read the wiki you recommended (https://github.com/volkanceylan/Serenity/wiki/BBB:-On-client-side,-fetching-a-value-from-server-side-out-of-database), and apparently it works, but I may have done something wrong or not adapted to what I wanted. All the entries in my table don't appear in the grid anymore. Here are all my codes:
Just explaining - this row I've sent the screenshot is in a row named AppTrustRow. The Apps are in another table (row) named AppRow. What I did was:
1 - Create the Endpoint in AppTrustEndpoint.cs (sorry, I don't know how to fix the problem in showing all usings like the second half of the code):
`
namespace DashboardSMICv2.Smic.Endpoints
{
using DashboardSMICv2.Modules.Common.Helpers;
using DashboardSMICv2.Smic.Entities;
using Serenity;
using Serenity.Data;
using Serenity.Services;
using System;
using System.Data;
using System.Web.Mvc;
using MyRepository = Repositories.AppTrustRepository;
using MyRow = Entities.AppTrustRow;
[RoutePrefix("Services/Smic/AppTrust"), Route("{action}")]
[ConnectionKey(typeof(MyRow)), ServiceAuthorize(typeof(MyRow))]
public class AppTrustController : Controller
{
    [HttpPost]
    public ActionResult GetApps(string platform)
    {
        String output = ManageApps.GetApps(platform);
        return Json(new { result = output }, JsonRequestBehavior.AllowGet);
    }

`
2 - Create a ManageApps in Common/Helpers:
`
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Serenity.Data;
using System.Data;
using appRow = DashboardSMICv2.Smic.Entities.AppRow;
namespace DashboardSMICv2.Modules.Common.Helpers
{
public class ManageApps
{
public static string GetApps(string platform)
{
var connection = SqlConnections.NewFor();
        var row = new appRow();
        if(new SqlQuery().From(row)
            .Select(appRow.Fields.UniqueName)
            .Where(appRow.Fields.Platform == platform)
            .GetSingle(connection))
        {
            return row.UniqueName;
        }

        return null;
    }
}

}
`
3 - Create an AppHelper.ts also in Common/Helpers:
`
namespace DashboardSMICv2.AppHelper {
export function GetAppName(Platform: string){
let myResult = "";
let serviceEndpoint = "/services/" + DashboardSMICv2.Smic.AppTrustService.baseUrl + "/GetApps";
    $.ajax({
        type: "post",
        dataType: "json",
        async: false,
        url: serviceEndpoint,
        data: { 'Platform': Platform },
        success: function (response) {
            if (response instanceof Object) {
                var json = response;
            }
            else {
                var json = $.parseJSON(response);
            }

            var output = json['result'];
            myResult = output;
        }.bind(this),
        error: function (jqxhr, textStatus, error) {
            var err = textStatus + ", " + error;
            alert("Erro! " + err);
        }
    });

    return myResult;
}

}
`
4 - Call the Helper function in AppTrustDialog.ts:
`
namespace DashboardSMICv2.Smic {
@Serenity.Decorators.registerClass()
export class AppTrustDialog extends Serenity.EntityDialog<AppTrustRow, any> {
    protected getFormKey() { return AppTrustForm.formKey; }
    protected getIdProperty() { return AppTrustRow.idProperty; }
    protected getLocalTextPrefix() { return AppTrustRow.localTextPrefix; }
    protected getService() { return AppTrustService.baseUrl; }

    protected form = new AppTrustForm(this.idPrefix);

    protected getToolbarButtons(): Serenity.ToolButton[] {

        var buttons = super.getToolbarButtons();

        buttons.push(
            {
                title: "Busca App",
                cssClass: 'buscaApp-button',
                onClick: () => {
                    let platform = "Android";
                    let myAppName = AppHelper.GetAppName(platform);

                    Q.notifySuccess(platform + " puxou o(s) app(s): " + myAppName);
                }
            });
        return buttons;

}
`
And what it does is:

All the entries are gone
And in the dialog:

Now it shows all the apps, but no filtering is made. Ok, the code really doesn't filter anything, so this is obvious to happen.
What I think may have happened is that I must have confused the places where to insert the ManageApps or Endpoint codes, and maybe the value type of the Platform variable is wrong, after all the value in the table is 10 or 11 (integer, not string) as well in HTML, which is where I imagine it fetches the value of each OS.
But it is something, indeed. I hope to count on your help, it has been of great value.

create lookup: AppLookup.cs
[LookupScript("Default.AppLookup")]
    public class AppLookup: RowLookupScript<DashboardSMICv2.Smic.Entities.AppRow>
    {
        public AppLookup()
        {
            IdField = DashboardSMICv2.Smic.Entities.AppRow.Fields.Id.PropertyName;
            TextField = DashboardSMICv2.Smic.Entities.AppRow.Fields.Name.PropertyName;
        }

        protected override void PrepareQuery(SqlQuery query)
        {
            var fld = DashboardSMICv2.Smic.Entities.AppRow.Fields;

            query.Select(fld.Id)
                .Select(fld.Name)
                .Select(fld.Platform)
                .Where(fld.Archive == 0);
        }

        protected override void ApplyOrder(SqlQuery query)
        {
        }
    }

in AppTrustDialog.ts

            this.form.OriginId.change((e) => {
                this.form.RailcarTypeId.cascadeField = "Platform";
                this.form.RailcarTypeId.cascadeValue = this.form.OriginId.value;
            })
``

Hi @luongnv6
Thanks for the suggestion, but I don't quite understand what this code does. If you can explain the idea to me, I'm grateful.
And we have two problems here: there is no fld.Archive field in AppLookup ... I don't know where that comes from by the way. The other problem is that the form in AppTrustDialog doesn't have RailcarTypeId, which I don't know where it comes from either. If you can better explain these things and work out how to solve them, that's great. I will test the code as soon as there is a way to fix these problems.

Hi @leovamos ,
the problem why all your grid rows are gone is because you have changed the original xyzEndpoint.cs controller type from what it was to "controller".
This does not work :-)
In my example oyu have to create an own - independent - controller (e.g. create it with sergen) and then change the class of that new controller (while leaving the original one in peace).
But I will try to make up an end to end example how to fill an empty dropdown with a list of values from the server side.
Give me some time...
John

Oh, I understand now. Thanks for explaining.
Ok, @JohnRanger, I'll be waiting for your example, and meanwhile, I'll try to understand how to solve this problem. Thanks again!

Use the EmptyLookupEditor from @dfaruque 's Serenity.Extra
Decorate the two appsId fields in your xyzRow.cs with it. [EmptyLookupEditor]

Create a new file called Select2DataItem.cs
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DashboardSMICv2.Modules.Common.Helpers
{
    public class Select2DataItem
    {
        public int id { get; set; }
        public string text { get; set; }
    }
}

Create a new Endpoint file called DataProvider.cs with the following content:
using System;
using DashboardSMICv2.Modules.Common.Helpers;
using System.Web.Mvc;
using System.Linq;
using Serenity.Data;
using System.Data;
using System.Collections.Generic;
using Newtonsoft.Json;

using appRow = DashboardSMICv2.Smic.Entities.AppRow;

namespace DashboardSMICv2.Common.Endpoints
{
    [RoutePrefix("Services/Common/DataProvider"), Route("{action}")]
    public class DataProviderController : Controller
    {
        [HttpPost]
        public ActionResult AppsForPlatform(int FilterId)
        {
            var connection = SqlConnections.NewFor<appRow>();
            var query = "select id, name from approw where platformId = " + FilterId;
            var Result = connection.Query(query);
            connection.Close();

            List<Select2DataItem> DataItems = new List<Select2DataItem>();
            foreach (var Resultrow in Result)
            {
                var data = (IDictionary<string, object>)Resultrow;
                var currentItem = new Select2DataItem();
                currentItem.id = (int)data[approw .Fields.id.Name];
                currentItem.text = (string)data[approw.Fields.Name.Name];
            }

            // *** Re-sort items ***
            DataItems = DataItems.OrderBy(o => o.text).ToList();

            var output = JsonConvert.SerializeObject(DataItems);
            return Json(output, JsonRequestBehavior.AllowGet);
        }
    }
}

Create a new file called JSONDataFetcher.ts and put the following inside:
namespace DashboardSMICv2.JSONDatafetcher {
// *** Fetches JSON Data from Server side ***
    export function GetItemsAsJSON(ServiceEndpointURL: string, FilterId: String) {

        let myresult = "";

        FilterId = (FilterId == "" ? "0" : FilterId);

        // *** Debug only ***
        //alert(ServiceEndpointURL);
        //alert(FilterId);

        $.ajax({
            type: "post",
            dataType: "json",
            async: false,
            url: ServiceEndpointURL,
            data: {
                'FilterId': FilterId
            }
            ,
            success: function (response) {

                if (response instanceof Object) {
                    var json = response;
                }
                else {
                    var json = JSON.parse(response);
                }

                var output = json;
                myresult = output;

            }.bind(this),
            error: function (jqxhr, textStatus, error) {
                var err = textStatus + ", " + error;
                alert("Error! " + err);
            }

        });

        return myresult;
    }
}

In the change event of your RadioButton field (I call it here PlatformId), insert the following:
                let ServiceEndpoint = "/services/Common/DataProvider/AppsForPlatform";
                var data = JSONDatafetcher.GetItemsAsJSON(ServiceEndpoint, this.form.PlatformId.value;
                this.form.AppId1.select2({data: data});
                this.form.AppId1.select2({data: data});

That should do it. I use this system in my apps to dynamically fill the dropdowns of fields directly from the database. Never having any caching problems - no matter how the data gets into the DB - and fully offloading the whole work to DB and Web server. That's for what they are made, no? :-)
Hope, this helps.
With kind regards,
John

@leovamos ,
in your screenshot - the Radiobutton line - how did you implement this? As a true Serenity editor or just DOM manipulation?
If it is a true radiobutoneditor, would you mind to share your code for this here?
With kind regards,
John

sorry @leovamos
The above code will cascade the data on App 1 according to the Platform (Android, ISO).
You just need to create a lookupeditor to get all the data for the App1 lookup (including the Platform field).
When you change the radio, you will set the cascade value for the App1 lookup to filter data.
same for App2 lookup
create lookup: AppLookup.cs
namespace DashboardSMICv2.Smic.CustomLookup
{
[LookupScript("Default.AppLookup")]
    public class AppLookup: RowLookupScript<DashboardSMICv2.Smic.Entities.AppRow>
    {
        public AppLookup()
        {
            IdField = DashboardSMICv2.Smic.Entities.AppRow.Fields.Id.PropertyName;
            TextField = DashboardSMICv2.Smic.Entities.AppRow.Fields.Name.PropertyName;
        }

        protected override void PrepareQuery(SqlQuery query)
        {
            var fld = DashboardSMICv2.Smic.Entities.AppRow.Fields;

            query.Select(fld.Id)
                .Select(fld.Name)
                .Select(fld.PlatformId);
        }

        protected override void ApplyOrder(SqlQuery query)
        {
        }
    }
}

in AppTrustForm.cs
public class AppTrustForm
    {
//.....
        [RadioButtonEditor]
        public Int32 PlatformId { get; set; }
        [LookupEditor(typeof(DashboardSMICv2.Smic.CustomLookup.AppLookup))]
        public Int32 App1Id { get; set; }
        [LookupEditor(typeof(DashboardSMICv2.Smic.CustomLookup.AppLookup))]
        public Int32 App2Id { get; set; }
       //......
    }

in AppTrustDialog.ts

            this.form.PlatformId.change((e) => {
                this.form.App1Id.cascadeField = "PlatformId";
                this.form.App1Id.cascadeValue = this.form.PlatformId.value;
                this.form.App2Id.cascadeField = "PlatformId";
                this.form.App2Id.cascadeValue = this.form.PlatformId.value;
            })
``

You should correct the field names to match your table structure, the above fields are based on my conjecture only

good luck

@leovamos ,
the solution of @luongnv6 looks for me the much more elegant solution than mine. So I recommend the solution of @luongnv6 .
With kind regards,
John

Well, guys, I tried the @luongnv6's solution, and here are the results:
First, the codes:
(I really wanna know how to fix this problem with some parts of the code doesn't showing like it should)
AppLookup.cs
`
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Serenity.ComponentModel;
using Serenity.Data;
using Serenity.Web;
namespace DashboardSMICv2.Smic.CustomLookup
{
[LookupScript("Smic.AppLookup")]
public class AppLookup: RowLookupScript<Smic.Entities.AppRow>
{
public AppLookup()
{
IdField = Smic.Entities.AppRow.Fields.AppId.PropertyName;
TextField = Smic.Entities.AppRow.Fields.UniqueName.PropertyName;
}
    protected override void PrepareQuery(SqlQuery query)
    {
        var fld = Smic.Entities.AppRow.Fields;

        query.Select(fld.AppId)
            .Select(fld.UniqueName)
            .Select(fld.Platform);
    }

    protected override void ApplyOrder(SqlQuery query)
    {
    }
}

}
`
AppTrustForm.cs
`
namespace DashboardSMICv2.Smic.Forms
{
using Serenity;
using Serenity.ComponentModel;
using Serenity.Data;
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.IO;
[FormScript("Smic.AppTrust")]
[BasedOnRow(typeof(Entities.AppTrustRow), CheckNames = true)]
public class AppTrustForm
{
    [RadioButtonEditor(typeof(PlatformEnum))]
    public PlatformEnum Platform { get; set; }
    [LookupEditor(typeof(CustomLookup.AppLookup))]
    public Int32 AppId1 { get; set; }
    [LookupEditor(typeof(CustomLookup.AppLookup))]
    public Int32 AppId2 { get; set; }
    [RadioButtonEditor(typeof(AppTrustStatus))]
    public AppTrustStatus Status { get; set; }
}

}
`
And AppTrustDialog.ts
`
namespace DashboardSMICv2.Smic {
@Serenity.Decorators.registerClass()
export class AppTrustDialog extends Serenity.EntityDialog<AppTrustRow, any> {
    protected getFormKey() { return AppTrustForm.formKey; }
    protected getIdProperty() { return AppTrustRow.idProperty; }
    protected getLocalTextPrefix() { return AppTrustRow.localTextPrefix; }
    protected getService() { return AppTrustService.baseUrl; }

    protected form = new AppTrustForm(this.idPrefix);

    protected getToolbarButtons(): Serenity.ToolButton[] {

        var buttons = super.getToolbarButtons();

        this.form.Platform.change((e) => {
            this.form.AppId1.cascadeField = "Platform";
            this.form.AppId1.cascadeValue = this.form.Platform.value;
            this.form.AppId2.cascadeField = "Platform";
            this.form.AppId2.cascadeValue = this.form.Platform.value;
        });

        return buttons;
  }
}

}
`
And it shows this:

In the console:
Uncaught TypeError: Cannot read property 'Platform' of undefined     at AppTrustDialog.getToolbarButtons (AppTrustDialog.ts:17)     at AppTrustDialog.TemplatedDialog.initToolbar (TemplatedDialog.ts:158)     at AppTrustDialog.EntityDialog.initToolbar (EntityDialog.ts:868)     at AppTrustDialog.TemplatedDialog [as constructor] (TemplatedDialog.ts:25)     at new EntityDialog (EntityDialog.ts:33)     at new AppTrustDialog (AppTrustDialog.ts:4)     at Function.Widget.create (Widget.ts:133)     at AppTrustGrid.EntityGrid.createEntityDialog (EntityGrid.ts:273)     at AppTrustGrid.EntityGrid.editItem (EntityGrid.ts:172)     at AppTrustGrid.EntityGrid.addButtonClick (EntityGrid.ts:168)
I ain't so sure about that, but my guess is that about the fact Platform is a PlatformEnum type, this may conflict with the rest of the code. But it's just a guess.
Well, hope you can help. Thanks.

Oh, by the way, I tried something I used in another code, and apparently it works, but I don't know how to proceed after that:
$(document).ready(function () {
$("input[name = 'Serenity_RadioButtonEditor10']").click(function () {
var radioValue = $("input[name='Serenity_RadioButtonEditor10']:checked").val();
});
});
This only gets the value in the radio button, and the next step should be use this value in a query to retrieve the apps which match the condition 'Platform = radioValue', but I don't know how to do that.

In row.cs
public class AppTrustRow{
        [DisplayName("Platform "), NotNull, QuickFilter]
        public PlatformEnum? Platform
        {
            get { return (PlatformEnum?)Fields.Platform [this]; }
            set { Fields.Platform [this] = (Int16?)value; }
        }
        [DisplayName("Archive"), NotNull]
        [LookupEditor(typeof(CustomLookup.AppLookup))]
        public Int32? AppId1
        {
            get { return Fields.AppId1[this]; }
            set { Fields.AppId1[this] = value; }
        }

        [DisplayName("Archive"), NotNull]
       [LookupEditor(typeof(CustomLookup.AppLookup))]
        public Int32? AppId2
        {
            get { return Fields.AppId2[this]; }
            set { Fields.AppId2[this] = value; }
        }

        [DisplayName("Status"), NotNull, QuickFilter]
        public AppTrustStatus ? Status
        {
            get { return (AppTrustStatus ?)Fields.Status[this]; }
            set { Fields.Status[this] = (Int16?)value; }
        }
         ...

       public class RowFields : RowFieldsBase
        {
....
            public Int16Field TypeCode;
            public Int32Field AppId1;
            public Int32Field AppId2;
            public Int16Field Status;
....
         }
}
``
In form.cs```
[FormScript("Smic.AppTrust")]
[BasedOnRow(typeof(Entities.AppTrustRow), CheckNames = true)]
public class AppTrustForm
{
    [RadioButtonEditor]
    public Int16 Platform { get; set; }
    public Int32 AppId1 { get; set; }
    public Int32 AppId2 { get; set; }
    [RadioButtonEditor]
    public Int16 Status { get; set; }
}

please T4 after rebuild

thanks

@leovamos ,
I don't have time to reverse-engineer @luongnv6 's proposal - but if you follow mine this would work. Look in the section "In the change event of your RadioButton field..." There I call the server-side webservice with giving over the ID of the chosen OS.
With kind regards,
John

Well, guys, I tried the @luongnv6's solution, and here are the results:
First, the codes:
(I really wanna know how to fix this problem with some parts of the code doesn't showing like it should)
AppLookup.cs
`
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Serenity.ComponentModel;
using Serenity.Data;
using Serenity.Web;
namespace DashboardSMICv2.Smic.CustomLookup
{
[LookupScript("Smic.AppLookup")]
public class AppLookup: RowLookupScript<Smic.Entities.AppRow>
{
public AppLookup()
{
IdField = Smic.Entities.AppRow.Fields.AppId.PropertyName;
TextField = Smic.Entities.AppRow.Fields.UniqueName.PropertyName;
}
    protected override void PrepareQuery(SqlQuery query)
    {
        var fld = Smic.Entities.AppRow.Fields;

        query.Select(fld.AppId)
            .Select(fld.UniqueName)
            .Select(fld.Platform);
    }

    protected override void ApplyOrder(SqlQuery query)
    {
    }
}

}
`
AppTrustForm.cs
`
namespace DashboardSMICv2.Smic.Forms
{
using Serenity;
using Serenity.ComponentModel;
using Serenity.Data;
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.IO;
[FormScript("Smic.AppTrust")]
[BasedOnRow(typeof(Entities.AppTrustRow), CheckNames = true)]
public class AppTrustForm
{
    [RadioButtonEditor(typeof(PlatformEnum))]
    public PlatformEnum Platform { get; set; }
    [LookupEditor(typeof(CustomLookup.AppLookup))]
    public Int32 AppId1 { get; set; }
    [LookupEditor(typeof(CustomLookup.AppLookup))]
    public Int32 AppId2 { get; set; }
    [RadioButtonEditor(typeof(AppTrustStatus))]
    public AppTrustStatus Status { get; set; }
}

}
`
And AppTrustDialog.ts
`
namespace DashboardSMICv2.Smic {
@Serenity.Decorators.registerClass()
export class AppTrustDialog extends Serenity.EntityDialog<AppTrustRow, any> {
    protected getFormKey() { return AppTrustForm.formKey; }
    protected getIdProperty() { return AppTrustRow.idProperty; }
    protected getLocalTextPrefix() { return AppTrustRow.localTextPrefix; }
    protected getService() { return AppTrustService.baseUrl; }

    protected form = new AppTrustForm(this.idPrefix);

    protected getToolbarButtons(): Serenity.ToolButton[] {

        var buttons = super.getToolbarButtons();

        this.form.Platform.change((e) => {
            this.form.AppId1.cascadeField = "Platform";
            this.form.AppId1.cascadeValue = this.form.Platform.value;
            this.form.AppId2.cascadeField = "Platform";
            this.form.AppId2.cascadeValue = this.form.Platform.value;
        });

        return buttons;
  }
}

}
`
And it shows this:

In the console:
Uncaught TypeError: Cannot read property 'Platform' of undefined
at AppTrustDialog.getToolbarButtons (AppTrustDialog.ts:17)
at AppTrustDialog.TemplatedDialog.initToolbar (TemplatedDialog.ts:158)
at AppTrustDialog.EntityDialog.initToolbar (EntityDialog.ts:868)
at AppTrustDialog.TemplatedDialog [as constructor] (TemplatedDialog.ts:25)
at new EntityDialog (EntityDialog.ts:33)
at new AppTrustDialog (AppTrustDialog.ts:4)
at Function.Widget.create (Widget.ts:133)
at AppTrustGrid.EntityGrid.createEntityDialog (EntityGrid.ts:273)
at AppTrustGrid.EntityGrid.editItem (EntityGrid.ts:172)
at AppTrustGrid.EntityGrid.addButtonClick (EntityGrid.ts:168)

Well, I tried again, with @luongnv6's help, and...

The line where the error comes up is:

It can't find this Platform field in form.

With this, it can't even open the form to create a new App Trust, it just shows that error and that's it.

Here is AppTrustDialog.ts:
`namespace DashboardSMICv2.Smic {
@Serenity.Decorators.registerClass()
export class AppTrustDialog extends Serenity.EntityDialog<AppTrustRow, any> {
    protected getFormKey() { return AppTrustForm.formKey; }
    protected getIdProperty() { return AppTrustRow.idProperty; }
    protected getLocalTextPrefix() { return AppTrustRow.localTextPrefix; }
    protected getService() { return AppTrustService.baseUrl; }

    protected form = new AppTrustForm(this.idPrefix);

    protected getToolbarButtons(): Serenity.ToolButton[] {

        var buttons = super.getToolbarButtons();

        this.form.Platform.change((e) => {
            this.form.AppId1.cascadeField = "Platform";
            this.form.AppId1.cascadeValue = this.form.Platform.value;
            this.form.AppId2.cascadeField = "Platform";
            this.form.AppId2.cascadeValue = this.form.Platform.value;
        });

       /* $(document).ready(function () {
            $("input[name = 'Serenity_RadioButtonEditor10']").click(function () {
                var radioValue = $("input[name='Serenity_RadioButtonEditor10']:checked").val();
                /*$.ajax({
                    url: 'AppTrustEndpoint.cs/get_data',
                    type: "post",
                    data: JSON.stringify(radioValue),
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function () {
                        alert("success");
                    }
                });
            });
        });*/

        return buttons;
    }
        /*var text = "Selected - ";
                if (radioValue.valueOf() == 10) {
                    alert("Android");
                } else {
                    alert("iOS");
                }*/

}

}`
There are some comments on it, but it's just attempts.

Also the field "platform" must be in the xyzForm.cs. If you don't want it to be shown, tag it with [hidden].
If it is in the xyzForm.cs, then a T4 transform (sometimes 2x) is neccessary to create the fields on the client-side (so that they appear when you do this.form.xxx.
Also if you do have callbacks, make sure that you put .bind(this) at the end of the callback code (after the closing bracket "}" in order to guide the callback to what scope "this" within the callback code belongs to).
Regards,
John

You should write events in the constructor
namespace DashboardSMICv2.Smic {

@Serenity.Decorators.registerClass()
export class AppTrustDialog extends Serenity.EntityDialog<AppTrustRow, any> {
    protected getFormKey() { return AppTrustForm.formKey; }
    protected getIdProperty() { return AppTrustRow.idProperty; }
    protected getLocalTextPrefix() { return AppTrustRow.localTextPrefix; }
    protected getService() { return AppTrustService.baseUrl; }

    protected form = new AppTrustForm(this.idPrefix);
 constructor() {
            super();
this.form.Platform.change((e) => {
            this.form.AppId1.cascadeField = "Platform";
            this.form.AppId1.cascadeValue = this.form.Platform.value;
            this.form.AppId2.cascadeField = "Platform";
            this.form.AppId2.cascadeValue = this.form.Platform.value;
        });

       /* $(document).ready(function () {
            $("input[name = 'Serenity_RadioButtonEditor10']").click(function () {
                var radioValue = $("input[name='Serenity_RadioButtonEditor10']:checked").val();
                /*$.ajax({
                    url: 'AppTrustEndpoint.cs/get_data',
                    type: "post",
                    data: JSON.stringify(radioValue),
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function () {
                        alert("success");
                    }
                });
            });
        });*/
}
    protected getToolbarButtons(): Serenity.ToolButton[] {

        var buttons = super.getToolbarButtons();
        return buttons;
    }
}

@luongnv6 and @JohnRanger, you're amazing! Thank you very much for the help. Now it's working how it should:

Android has six apps and iOS doesn't have any associated yet

Now for clarification and later use in perhaps an upcoming attempt to change a Form. Why is the code in the constructor()? I mean, what is this constructor method for? I know, the name is trivial, but I want to understand the methods better.
And reading the code better, it seems to me that this format in which it is written is basically:
"This field of this form has such a value". It looks like a jQuery, but simplified. My real confusion is in cascadeField and cascadeValue, what are they?
Anyway, thank you so much for the help. I'm glad to have @JohnRanger 's constant help and now with your, @luongnv6.

Hey, @luongnv6
I had some problems with posting code in my issues, and now I'm deleting all my codes from my issues. Could you delete or erase all your comments with codes, please? It will help me a lot.


Feature request: Support Middy 4.x

Use case
Middy 4 has been out quite long and if using lambda with Node 18, we want to use Middy 4 because of the AWS SDK v3 support.
Is there any plans to support Middy 4?
Sorry if this is a duplicate, but couldn't find any similar feature request.
Solution/User Experience
Upgrade middy package
Alternative solutions
No response
Acknowledgment

[X] This feature request meets Powertools for AWS Lambda (TypeScript) Tenets
[ ] Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, Java, and .NET

Future readers
Please react with 👍 and your use case to help us understand customer demand.

Hi @mk0sojo thanks for opening the issue.
The current latest version of Powertools for AWS supports all currently available Node.js AWS Lambda runtimes: nodejs14x, nodejs16x, and nodejs18x.
With version 4.x Middy dropped support of Node.js 14, which prevents us from recommending it to all our customers since we can't reliably run integration tests on that runtime.
We are aware that Node.js 14 has reached EOL but for the time being we have aligned our runtimes (aka Node.js versions) support with Lambda. This means that we'll drop support for this version in the coming weeks as announced in #1664.
Shortly after that we'll likely also start recommending Middy 4.x.
In any case, we only really rely on @middy/core, which at the best of my knowledge hasn't introduced any breaking change between versions 3.x and 4.x, so if using Node.js 16 or newer you should be able to use it with Powertools.

While @middy/core doesn't rely on the AWS SDK, a lot of other middy middlewares does and since v.4 they use AWS SDK v3 rather than AWS SDK v2, for example, the SSM middleware (https://middy.js.org/docs/upgrade/3-4/#ssm). So as part of our upgrade from Node 16 to Node 18 (and AWS SDK v2 to v3). We will therefor hold off using the lambda powertools until Middy 4 is supported.

This is available in preview starting from the 2.0.0-alpha.1 release. You can install this version using the next tag, i.e. npm i @aws-lambda-powertools/logger@next.


airgapped k8s - changing private image registry

issue description:
i'm using a airgapped k8s environment, when i want to start a shell to one of the worker node with lens, it deploys a pod, but since i'm on airgapped env., it's not possible to pull the image from gcr.io,
What would you like to be added:
is it possible to change the image registry settings to private registry in the settings page ?
Why is this needed:
if we have ability to change the image registry value on settings, that would make sense on airgapped env.s
Environment you are Lens application on:

Kubernetes distribution: pivotal pks
Desktop OS: linux

dupe?
https://github.com/lensapp/lens/issues/590

dupe?
#590

Yes. Closing this in favor of #590. Let's track the progress there.


Authentication error messages are ignored in the authenticate action in the user controller

In the authenticateAction of the UserController, if the authentication fails, the code sets the flash messenger with the canned message: Authentication failed. Please try again.
The code is:
if (!$auth->isValid()) {
            $this->flashMessenger()->setNamespace('lmcuser-login-form')->addMessage($this->failedLoginMessage);
            $adapter->resetAdapters();
            return $this->redirect()->toUrl(
                $this->url()->fromRoute(static::ROUTE_LOGIN) .
                ($redirect ? '?redirect='. rawurlencode($redirect) : '')
            );
        }

where $this->failedLoginMessage is set to Authentication failed. Please try again. and thereby ignores any error messages that would have been available in $auth.
The use case that I have is that if a user is not in a valid state for login (eg disabled), then the error message should be 'A record with the supplied identity is not active.', if using the adapter provided with LmcUser.
I am surprised that no one has raised this issue before.

After further review, I think this behaviour is correct.  The message provided to the view via FlashMessenger should be generic and not provide more detailed information as to why the authentication failed.  For example, flashing a message saying that the user record does not exist could be providing to muich information to a hacker/robot.
This will not be fixed.


options: { name: name }  not work correctly

Hello
I used your library and implemented your example
Everything works fine
But options: {name: name} does not work properly, and return Hallo, {{name}}!
please guide me

Same thing happens to me. Maybe some of dependencies broke?

I have debugged the code and the }} {{ is not controlled in regx expression
I should probably have an option enabled

@YaghoubJalali Did you solve it?

@all I also got into the same issue and I found the solution. Based on i18next library interpolation syntax is {{Content}}. It replaces the word with in the curly basis but in this library author mentioned __ as an interpolation characters. So in this example, "Hello {{name}}" we need to replace curly basis {{ with an double underscores(__) like "Hello name". This solves the problem.


Confusing error message when trying to list workspaces in organization workspace that doesn't exist

Describe the bug
When trying to access /clusters/root:$someOrg and the request is denied (e.g. that org workspace does not exist), the server returns a confusing error message:
error: workspaces.tenancy.kcp.dev "someOrg" is forbidden: "root" workspace access not permitted

To Reproduce
Steps to reproduce the behavior:

Start kcp
kubectl get --raw /clusters/root:someorg/apis/tenancy.kcp.dev/v1beta1/workspaces
Error from server (Forbidden): workspaces.tenancy.kcp.dev "someorg" is forbidden: "root" workspace access not permitted

Expected behavior
A clear, meaningful error message.
Additional context
Add any other context about the problem here.

We cannot leak whether the org exists or access is not allowed. So we need one message for both. But we can say something like "Access to the organization / top-level workspace root:foo not permitted".


compile.sh: 2: compile.sh: Syntax error: "(" unexpected

Hi
Now I get stuck by this error:
/Anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/include/absl/strings/string_view.h(496): error: constexpr function return is non-constant
I think that might have some relation with the version of cuda and tensorflow, do you have some ideas about that.
Besides, thanks for your work, I can hardly find a runnable correlation layer written in tensorflow.

Ubuntu 16.04, cuda 9, tensorflow 1.10 below recommended.


Issue with M3U8 contain POD1/POD2 Multiple map in one playlist

Hi, first of all, great job for your tool ! Amazing work, but ive rand into an issue lately, i'm trying to download a playlist, which as multiple map inside and i think your tool doesnt handle well
#EXTM3U
#EXT-X-VERSION:6
#EXT-X-TARGETDURATION:9
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PROGRAM-DATE-TIME:2019-01-01T00:00:00.000Z
#EXT-X-DATERANGE:ID="pod_0",START-DATE="2019-01-01T00:00:00.000Z",DURATION=3.003,X-START-OFFSET="0.0"
#EXT-X-KEY:METHOD=SAMPLE-AES-CTR,KEYFORMAT="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",KEYFORMATVERSIONS="1",URI="data:text/plain;base64,AAAAMnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAABISENc7OanL30hQgeRTwz/Qmhk="
#EXT-X-MAP:URI="70a48659-6d50-4228-8e5c-1f43abc32d47/83c9-BUMPER/02/4250K/map.mp4"
#EXTINF:3.003,
70a48659-6d50-4228-8e5c-1f43abc32d47/83c9-BUMPER/02/4250K/00/00/00_000.mp4
#EXT-X-DISCONTINUITY
#EXT-X-DATERANGE:ID="pod_1",START-DATE="2019-01-01T00:00:03.003Z",DURATION=6581.700125,X-START-OFFSET="3.003"
#EXT-X-MAP:URI="d585dde2-d29d-4501-a84b-40c5eb3aba5c/7a46-MAIN/02/4250K/map.mp4"
#EXTINF:8.008,
d585dde2-d29d-4501-a84b-40c5eb3aba5c/7a46-MAIN/02/4250K/00/00/00_000.mp4

Yes, I only identified the first #EXT-X-MAP and drop others. You can try manually editing M3u8 and use --baseUrl to download it.
BTW, N_m3u8DL-CLI can not decrypt SAMPLE-AES-CTR.

Yes, it's ok i know, i use your tool to skip this "encryption" only to get the files beacause ffmpeg dont support it (or never will), but the map/pod=id is realy annoying :/


FlatList onEndReached invoked endlessly

Implemented pull up to load more feature in my app. The FlatList of react-native component is utilized, nested inside Content.
      <Container>
        <Header />
        <Content padder={false}>
          <FlatList
              data={this.state.data}
              renderItem={({ item }) => (
                <Text>{`${item.name.first} ${item.name.last}`}</Text>
              )}
              keyExtractor={item => item.email}
              ItemSeparatorComponent={this.renderSeparator}
              ListHeaderComponent={this.renderHeader}
              ListFooterComponent={this.renderFooter}
              onEndReached={this.handleLoadMore}
              onEndReachedThreshold={0.01}
            />
          </Content>
      </Container>

node, npm, react-native, react and native-base version
node: v9.11.1
react-native: 0.56.0
react: 16.4.1
native-base: 2.7.2
Expected behaviour
scroll list until end of current page, then onEndReached is triggered to load more items of next pages.
Actual behaviour
as soon as screen loaded, onEndReached is invoked endlessly.
Steps to reproduce should include code snippet and screenshot
use the uploaded sample source code can reproduced this issue.
(Note that in the sample source code, only allow load up to 5 page. )
FlatListInNativeBase.zip
cd FlatListInNativeBase
npm install
react-native run-android

As soon as app launched, you can see from debug log

handleLoadMore was invoked five times, so that handling loadmor output five times.
Is the bug present in both iOS and Android or in any one of them?

presented in Android device (Galaxy S7 edge, Android 7.0)
presented in iOS simulator iPhon6 iOS 11.4

Any other additional info which would help us debug the issue quicker.

duplicate with issue #1736
and comment https://github.com/GeekyAnts/NativeBase/issues/1736#issuecomment-401815949 solved the issue.

contentContainerStyle={{flex: 1}} fixes the onEndReached issue but after it the refreshControl doesn't work properly anymore. It triggers the pull to refresh loader even if scroll isn't at the top of the page :(

Implemented pull up to load more feature in my app. The FlatList of react-native component is utilized, nested inside Content.
      <Container>
        <Header />
        <Content padder={false}>
          <FlatList
              data={this.state.data}
              renderItem={({ item }) => (
                <Text>{`${item.name.first} ${item.name.last}`}</Text>
              )}
              keyExtractor={item => item.email}
              ItemSeparatorComponent={this.renderSeparator}
              ListHeaderComponent={this.renderHeader}
              ListFooterComponent={this.renderFooter}
              onEndReached={this.handleLoadMore}
              onEndReachedThreshold={0.01}
            />
          </Content>
      </Container>

node, npm, react-native, react and native-base version
node: v9.11.1
react-native: 0.56.0
react: 16.4.1
native-base: 2.7.2
Expected behaviour
scroll list until end of current page, then onEndReached is triggered to load more items of next pages.
Actual behaviour
as soon as screen loaded, onEndReached is invoked endlessly.
Steps to reproduce should include code snippet and screenshot
use the uploaded sample source code can reproduced this issue.
(Note that in the sample source code, only allow load up to 5 page. )
FlatListInNativeBase.zip
cd FlatListInNativeBase
npm install
react-native run-android

As soon as app launched, you can see from debug log

handleLoadMore was invoked five times, so that handling loadmor output five times.
Is the bug present in both iOS and Android or in any one of them?
* presented in Android device (Galaxy S7 edge, Android 7.0)

* presented in iOS simulator iPhon6 iOS 11.4

Any other additional info which would help us debug the issue quicker.

A quick one. Just remove the FlatList from Content


Automated Package Upgrade

:tada: This PR is included in version 25.3.119 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


How to properly handle smart/dumb components and store interaction

I'm currently working on a view an in app that shows a number of tiles in two separate tabs, a Home tab and a Recent tab. Each tile is a TileComponent. Multiple tiles can be grouped together, and form a TileGroupComponent. When you click on a tile, you're taken to a view specific to that item.
The TileComponent is the lowest-level component that I have.  Good.
 I don't feel it actually could have any business logic since all it does is render a few tiles in a group presentation. It makes no logical sense to have any application logic in it.
Now, I'd like to handle clicks on tiles, so that the app will navigate to the specific view for that item. In my TileGroupComponent template I handle click events on my tiles by emitting a tileClick event.
<tile *ngFor="let tile of tiles" (click)="tileClick.emit(tile)"></tile>

That tileClick event is handled by my smart component called HomeComponent, where the TileGroupComponent is rendered. The smart component dispatches an action to the store. What happens next is irrelevant.
<home>
  <tile-group
    *ngFor="let tileGroup of tileGroups"
    (tileClick)="dispatchToStore($event)">
  </tile-group>
</home>

But then, I also have the RecentComponent, which is similar to HomeComponent, but shows recently accessed tiles, as the name suggests. I'd obviously like to not repeat myself from HomeComponent, so what am I to do when implementing RecentComponent?

My original question ended there, and as I wrote that, my computer played the role of a "Rubber Duck", so I have managed to answer myself - sort of - I think - maybe. I'd still like to read someone else's opinion.

I don't really like to put the responsibility of dispatching to the store on TileGroupComponent since I think it makes no logical sense to belong there.
The other option is to introduce a new container component, that both HomeComponent and RecentComponent will render as their top-level component. Makes sense to me. Does it to you?
What are any other/better options?

Suggestion: Move shared action-dispatching code to a separate Injectable, solely responsible for dispatching actions to the store. Looking ahead, your dispatchers would handle connecting to APIs with Http, subscribing to the response Observable, and dispatching "~FOO_DATA_RETRIEVED" actions to the store. This is the pattern I'm using in my application.

I think my challenge here is where to put code that handles the click events and dispatches the appropriate action (whether directly or indirectly through another service), without causing code duplication.
The best way I can think of is for both HomeComponent and RecentComponent to contain a common top-level container that would be responsible for dispatching the action.

So the redundancy you name is only calling a service which is dispatching an action (if you would outsource the dispatching to a service)? Is there a practical reasoon to avoid such a redundancy? I would not even call it that way ;) However, if you have a common top-level component it makes you can delegate responsibility. However, when your application will grow, it may make sense to split up responsibility, I think you should not always delegate everything to the top-level.

As @spicywhitefish suggests you should inject a TileService into both HomeComponent and RecentComponent.  This service should create and dispatch the action to the store.

Pretty much agree with all the suggestions here.


[Suggestion] Move defaults into provision package

@alexellis how would you feel about moving the provisioner defaults into the provision package and removing the additional section? The only config currently in there is for projectID, port and zone. If we make port a constant and add it to provision as well then we only have to add projectID and zone to BasicHost which can be populated if set. This would also require some minor changes to a couple of the provisioners.
Something like this in provision.go
func NewBasicHost(provider, name, region, projectID, zone, userData string) (*BasicHost, error) {
	if _, ok := defaults[provider]; !ok {
		return nil, fmt.Errorf("no provisioner for provider: %q", provider)
	}
	host := &BasicHost{
		Name:      name,
		OS:        defaults[provider].os,
		Plan:      defaults[provider].plan,
		UserData:  userData,
		ProjectID: projectID,
		Zone:      zone,
	}
	if region == "" && len(defaults[provider].region) != 0 {
		host.Region = defaults[provider].region
	}  else {
		host.Region = region
	}
	return host, nil
}

type provisionerDefaults struct {
	os     string
	plan   string
	region string
}

const ControlPort = 8080

var defaults = map[string]provisionerDefaults{
	"digitalocean": {
		os:   "ubuntu-16-04-x64",
		plan: "512mb",
	},
	"packet": {
		os:     "ubuntu_16_04",
		plan:   "t1.small.x86",
		region: "ams1",
	},
	"scaleway": {
		os:     "ubuntu-bionic",
		plan:   "DEV1-S",
		region: "fr-par-1",
	},
	"civo": {
		os:   "811a8dfb-8202-49ad-b1ef-1e6320b20497",
		plan: "g2.small",
	},
	"gce": {
		os:   "projects/debian-cloud/global/images/debian-9-stretch-v20191121",
		plan: "f1-micro",
	},
	"ec2": {
		os:     "ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20191114",
		plan:   "t3.nano",
		region: "eu-west-1",
	},
}

I am happy to do the work for this if you think it is a good idea. No worries if not.

I'm still trying to grok this, let me take another look in the new year.

@alexellis, I am happy to create a pull request with the proposed change as it might make more sense as a diff.

@alexellis, I have created a PR to demonstrate what I was suggesting.


Commands not working

Bot is running and online with administrator permissions to the server but doesn't respond to commands.
I have done !myakish and @botname !myakish and it will not grant me admin to the server.

Noticed the bot seems to be going offline shortly after starting it via bash terminal:
:PossumBot-master username$ ./startbot.sh
Loading Commands...
PossumBot Is Now Activated
https://discord.com/api/oauth2/authorize?client_id=1193680097966817411&permissions=8&scope=bot
/Users/username/Downloads/PossumBot-master/bot.js:60
let cmd = bot.commands.get(command.slice(prefix.length));
^
TypeError: Cannot read properties of undefined (reading 'slice')
at Client. (/Users/username/Downloads/PossumBot-master/bot.js:60:37)
at Client.emit (node:events:514:28)
at MessageCreateAction.handle (/Users/username/Downloads/PossumBot-master/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at module.exports [as MESSAGE_CREATE] (/Users/username/Downloads/PossumBot-master/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/Users/username/Downloads/PossumBot-master/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
at WebSocketShard.onPacket (/Users/username/Downloads/PossumBot-master/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/Users/username/Downloads/PossumBot-master/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
at WebSocket.onMessage (/Users/username/Downloads/PossumBot-master/node_modules/ws/lib/event-target.js:132:16)
at WebSocket.emit (node:events:514:28)
at Receiver.receiverOnMessage (/Users/username/Downloads/PossumBot-master/node_modules/ws/lib/websocket.js:834:20)
Node.js v20.10.0

Bot is still not successfully staying online but now I have more info to contribute to the thread.
Bot is failing to execute commands and printing in console:
DiscordAPIError: Missing Permissions
at RequestHandler.execute (/Users/username/Downloads/PossumBot-master/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RequestHandler.push (/Users/username/Downloads/PossumBot-master/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
at async module.exports.run (/Users/username/Downloads/PossumBot-master/commands/myakish.js:7:16)
This is despite adding the bot to the server with the permission integer of 8 for Administrator.

im getting the same problem rn i can get it to stay online but when i put in any commands i get this
TypeError: Cannot read properties of undefined (reading 'slice')

same problem here
idk what to do

Fixed


Support of Intel Stack on Visual Studio Online Continuous Integration

I require Intel Stack on VSO CI.
Please considered the added value of an additional compiler platform.

The agent doesn't deliver tools and never should.  That creates a bad coupling.
This is about the OS / image that that agent is installed on.  If you're referring to the hosted pool (our convenience image), then it should be noted that it will never contain all the possible developer tools and every version.
To control the toolsets you want installed, you can configure your own private agent - on an azure VM or your own machine.  That gives you tool control, incremental build and incremental source as well.
https://www.visualstudio.com/en-us/docs/build/admin/agents/v2-windows

This issue marks initiation of conversation of Intel Stack CI support in VSO.
Is there a more fitting Microsoft project with which to open an issue?
This issue requires support/interoperation between Intel & Microsoft.


Attached Property receives null in setter when reference type is used

Describe the bug
The following attached property will receive null in the setter:
public calss SomeClass
{
}

public class SomeAttachedProperty : DependencyObject
    {
        public static readonly DependencyProperty TypeProperty =
        DependencyProperty.RegisterAttached(
          "SomeAttachedProperty",
          typeof(Type),
          typeof(SomeAttachedProperty),
          new PropertyMetadata(null)
        );
        public static void SetType(DependencyObject element, Type value)
        {
            element.SetValue(TypeProperty, value); //here we expect Type SomeClass to be passed but we get null
        }
        public static Type GetType(DependencyObject element)
        {
            return (Type)element.GetValue(TypeProperty);
        }
    }

XAML
    <DataTemplate x:Key="SomeKey" local:SomeAttachedProperty.Type="UWPTest2:SomeClass">
`
<Grid>
    <Button>
        <Button.ContentTemplate>
            <DataTemplate `local:SomeAttachedProperty.Type="local:SomeClass">`
                <TextBlock Text="hello"/>
            </DataTemplate>
        </Button.ContentTemplate>
    </Button>
</Grid>

`
however if we change the "Type" to "String" it will work but obviously that is not what the SomeAttachedProperty  is designed for:
public class SomeAttachedProperty : DependencyObject
    {
        public static readonly DependencyProperty TypeProperty =
        DependencyProperty.RegisterAttached(
          "SomeAttachedProperty",
          typeof(string),
          typeof(SomeAttachedProperty),
          new PropertyMetadata(null)
        );
        public static void SetType(DependencyObject element, string value)
        {
            element.SetValue(TypeProperty, value); //here "someNameSpace:SomeClass" will be passed fine,
        }
        public static string GetType(DependencyObject element)
        {
            return (string )element.GetValue(TypeProperty);
        }
    }

Steps to reproduce the bug
use the attached property from the description and check the results
Expected behavior
expected to receive Type and not null
Screenshots
No response
NuGet package version
No response
Windows app type

[X] UWP
[ ] Win32

Device form factor
No response
Windows version
No response
Additional context
No response

@evelynwu-msft FYI

Comment


mindate & maxdate

Hi, I am trying to set a mindate within the directive declaration, like this:

My minDate variable is calculated through moment js before that. But I just can't make it work. The calendar does not really disable any day buttons. Thanks in advance.

Not sure but I think you mean to have mindate="{{minDate}}" ?
If you inspect element on the html it might make it more clear - mindate and maxdate are observed so all changes are picked up. Check the examples in the gh-pages fork as well.
If you're still having issues run up a plnkr or codepen or similar and I can have a look.


tensor parallelism across multiple GPU's

I am following the code as mentioned in the AWS documentation to host GPT-J-6B using DJL serving
[ https://github.com/aws/amazon-sagemaker-examples/blob/main/advanced_functionality/pytorch_deploy_large_GPT_model/GPT-J-6B-model-parallel-inference-DJL.ipynb]
Providing a tensor parallelism value as 2 in serving.properties  creates 2 copies of the model rather than partitioning  model layers across  two GPU's . This happens irrespective of using a smaller/larger model.
Instance used :
ml.g4dn.12xlarge

g4dn.12x has 4 gpus, DJLServing will automatically expend to all GPUs. So you see 2 workers (each worker use 2GPUs)

@samanthvishwas Closing the issue. Please open a new one, if you have any more questions.


⚠ ClamAV has degraded performance

In 9af4584, ClamAV (https://spamassassin.apache.org/) experienced degraded performance:

HTTP code: 200
Response time: 51 ms

Resolved: ClamAV performance has improved in a1506ea.


A11y_Model Builder_Advanced data option_Data Formatting_Info and relationship: Screen reader is not reading the entire label information along with" i.e first row in the table".

GitHubTags
#WCAG1.3.1; #A11ySev3; #A11yTCS; #A11yWCAG2.1; #DesktopApp; #Win11; #Visual Studio Client; #SH_ModelBuilder_Win32_May2023; #Info and Relationships; #Screenreader; #Narrator; #FTP; #Win32; #Benchmark;
Actual Result
Screen reader is not reading the entire label information along with" i.e first row in the table".
It is reading only "Does the data contain column header".
Issue observed throughout the application.
Issue reproducible with NVDA.
Expected Result
Screen reader should read the entire label information along with" i.e first row in the table".
Environment Details
Application Name: Microsoft Visual Studio Enterprise 2022 (64-bit) - Current
Version 17.6.1
Microsoft Windows 11 Enterprise 10.0.22621 Build 22621
Screen reader: Narrator, NVDA
Repro Steps

Turn on Narrator/NVDA.
Launch the Visual Studio with at least one of the .NET workload.
Tab till enable ML.NET Model Builder (Tools -> Options -> Environment -> Preview Features) and select it.
Create a new .NET project or open an existing .NET project.
Open context menu(Right-click) of the project in the solution explorer.
Tab till Add and then tab till Machine Learning Model and press enter.
Model Builder dialog will open. Complete Scenario and Environment setup steps.
Add Data screen will appear. Tab till Advance data option.
Advance data option screen will appear, tab till Data formatting and press enter.
Verify whether the screen reader is reading the entire label information along with" i.e first row in the table" or not.

User Impact
Screen reader user will not be able to get the proper information regarding the radio button / labels.
Attachment

As this is a sev3 bug and will not block your compliance, please add this bug to your backlog if you want to fix this in future.
#Regressed:06-01-23;


ValidatingTextBox default state should not be "invalid"

If I add a ValidatingTextBox with some rules to a page it shows as "invalid" even before the user starts typing or focuses it.

I'll explore this. Have you set the mandatory property to true?

Yes, IsMandatory="True" and two way binding for Text

By setting the mandatory flag, the control will default to invalid if there is no text. This is intended.

 If we believe this is still an issue, please let me know :smile:


Don't use extra port for replication

As we know, in order to implement replication, kvrocks has specified replication threads  that use 'port + 1' as listening port, that may make somethings easy, but it is not convenient to deploy and maintain.
In this PR, kvrocks doesn't use extra port for replication instead of processing replication requests in general work threads.
Some problems we need to care
Blocking
We can't block work threads for processing replication requests. Currently, for replication commands, _fetch_meta and _fetch_file are blocked, in this commit, we process both commands in new threads.
Compatibility
We provide a configuration item master-use-repl-port to make new version able to replicate old version master. If the masters are old version, you should set master-use-repl-port to yes, otherwise you should set it to no.

hi @git-hulk @karelrooted  Currently i just implement basic function. we still need to test its performance although it doesn't have damage.
We still have some other jobs for this change, such as clean up jobs, replication connection identifier, ... But i don't want to make one PR too complicated to review, it is hard to find problems. We can fix these in other PRs.

It should be fine to merge the PR since the master was defined as unstable now. Also, those problems weren't imported by this PR so makes a lot of sense to file a new PR.


tesseract 4.0 Compiling don't work for me

I followed the steps in https://github.com/tesseract-ocr/tesseract/wiki/Compiling#linux
I downloaded from https://github.com/tesseract-ocr/tesseract zip file.
OS: Centos 7
Compiler: gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
I found error written so I installed autoconf-archive and in order to resolve error with "Leptonica 1.74" I have done:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export LIBLEPT_HEADERSDIR=/usr/local/include
export TESSDATA_PREFIX='/usr/local/share/'
./configure --with-extra-includes=/usr/local/include --with-extra-libraries=/usr/local/lib
LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make
but I receive this error:
In file included from rect.h:28:0,
from coutln.h:26,
from stepblob.h:23,
from werd.h:28,
from blobbox.h:25,
from blobbox.cpp:25:
blobbox.h: In member function 'void TO_BLOCK::print_rows()':
blobbox.h:737:61: error: expected ')' before 'PRId32'
tprintf("Row range (%g,%g), para_c=%g, blobcount=%" PRId32 "\n",
^
../ccutil/tprintf.h:31:39: note: in definition of macro 'tprintf'
#define tprintf(...) tprintf_internal(VA_ARGS)
^
make[2]: *** [blobbox.lo] Error 1
make[2]: Leaving directory /home/webuser/src/tesseract-4.0/ccstruct' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/home/webuser/src/tesseract-4.0'
make: *** [all] Error 2
Can you help me?
thanks

Did you run autogen.sh again after installing autoconf-archive?

Seems to be related to this change:
https://github.com/tesseract-ocr/tesseract/pull/905/commits/ef1d9600b1#diff-f65400671330df624f228888e8ee46ba

@oscaroxy The master branch is the development branch for 4.0 alpha. Please try to build using a commit before the one mentioned by @amitdo .

I follow your actual advice, I restart then I done:
git clone https://github.com/tesseract-ocr/tesseract.git
cd tesseract
./autogen.sh
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export LIBLEPT_HEADERSDIR=/usr/local/include
export TESSDATA_PREFIX='/usr/local/share/'
./configure --with-extra-includes=/usr/local/include --with-extra-libraries=/usr/local/lib
LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make
I obtain:
In file included from rect.h:28:0,
from coutln.h:26,
from stepblob.h:23,
from werd.h:28,
from blobbox.h:25,
from blobbox.cpp:25:
blobbox.h: In member function 'void TO_BLOCK::print_rows()':
blobbox.h:737:61: error: expected ')' before 'PRId32'
tprintf("Row range (%g,%g), para_c=%g, blobcount=%" PRId32 "\n",
^
../ccutil/tprintf.h:31:39: note: in definition of macro 'tprintf'
#define tprintf(...) tprintf_internal(VA_ARGS)
^
make[2]: *** [blobbox.lo] Error 1
make[2]: Leaving directory /home/webuser/src/tesseract/ccstruct' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory /home/webuser/src/tesseract'
make: *** [all] Error 2
thanks

OS: Centos 7
Compiler: gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)

I have built only on ubuntu, not centos. Maybe there are differences in the o/s causing the issue.
Since now you have downloaded source using git clone, you can use git to go back to an older commit and try the build there.
git reset --hard 2008dafa7310970002302083659575819e57bb67

will take you back to a commit about 4 days back before the commit @amitdo referred to.
you can give the following command to verify
git log -1

Please try your build there again.

I installed tesseract 3.05 (because other version previous one the 3.05 I don't find) and all it's ok, but so isn't the version 4.0 ready?
thanks

4.0 can be compiled without an error by the continuous integration tests, in several of my test environments and by other people, too. So we need your help to find what is special in your case.
Could you have a look at the file ccstruct/.deps/blobbox.Plo? It must include an entry /usr/include/inttypes.h. That file defines the PRId32 macro.
Try also a simplified build like this:
git clone https://github.com/tesseract-ocr/tesseract.git
cd tesseract
./autogen.sh
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
./configure
make

From checking for similar error messages it appears that CentOS 7 and a few other versions of CentOS only define the PRId32 macro when the macro #define __STDC_FORMAT_MACROS 1 is set. @oscaroxy, check if manually passing this via CPPFLAGS=-D__STDC_FORMAT_MACROS 1 resolves the issue.
It's not clear to me where Tesseract actually includes <inttypes.h>, so define it globally as a test.
Discussion of this issue in other projects:
https://groups.google.com/a/chromium.org/forum/#!topic/chromium-reviews/FyaFYXyzZeU
https://stackoverflow.com/questions/8132399/how-to-printf-uint64-t-fails-with-spurious-trailing-in-format/8132440#8132440

stweil, I done more, that is:
git clone https://github.com/tesseract-ocr/tesseract.git
cd tesseract
./autogen.sh
./configure
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export LIBLEPT_HEADERSDIR=/usr/local/include
export TESSDATA_PREFIX='/usr/local/share/'
LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make
but nothing... same error:
In file included from rect.h:28:0,
from coutln.h:26,
from stepblob.h:23,
from werd.h:28,
from blobbox.h:25,
from blobbox.cpp:25:
blobbox.h: In member function 'void TO_BLOCK::print_rows()':
blobbox.h:737:61: error: expected ')' before 'PRId32'
tprintf("Row range (%g,%g), para_c=%g, blobcount=%" PRId32 "\n",
^
../ccutil/tprintf.h:31:39: note: in definition of macro 'tprintf'
#define tprintf(...) tprintf_internal(VA_ARGS)
^
make[2]: *** [blobbox.lo] Error 1
make[2]: Leaving directory /home/webuser/src/tesseract/ccstruct' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory /home/webuser/src/tesseract'
make: *** [all] Error 2

I'm sorry Mr. jbarlow83, I didn't understand your advice, I don't know What to do, where do I pass CPPFLAGS='-D__STDC_FORMAT_MACROS=1' ?
Where do I see where Centos 7 set "#define __STDC_FORMAT_MACROS 1"?
thanks

Try this:
git clone https://github.com/tesseract-ocr/tesseract.git
cd tesseract
./autogen.sh
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
./configure CXXFLAGS="-D__STDC_FORMAT_MACROS=1"
make

I follow your step and replace "make" with LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make.
All ara to right, now I've (tesseract -v):
tesseract 4.00.00alpha
leptonica-1.74.1
libjpeg 6b (libjpeg-turbo 1.2.90) : libpng 1.5.13 : libtiff 4.0.5 : zlib 1.2.7
Found AVX
Found SSE
Only in order to understand, is the param CXXFLAGS="-D__STDC_FORMAT_MACROS=1" local to configure tesseract? do it don't interact with other config, right?
thanks

We have two options:

Fix this issue (only relevanth when the system glibc < 2.18 )
Document the solution with the environment variable.

I'd fix the issue by always setting __STDC_FORMAT_MACROS (that won't harm for newer glibc).
For the future, the format macros (also REFFORMAT) could be avoided by using C++ code instead of C format strings.

Would including cinttypes instead of inttypes.h also fix the problem?

In fact:
#ldd --version
ldd (GNU libc) 2.17
I resolve with __STDC_FORMAT_MACROS, but if I update glib, is it better?
Excuse me, stweil, but you haven't reply my question... thanks
"Only in order to understand, is the param CXXFLAGS="-D__STDC_FORMAT_MACROS=1" local to configure tesseract? do it don't interact with other config, right?"

How do I include cinttypes? where do I find this file? where I put this file?
thanks

do it don't interact with other config, right?

Right.
Change file ccutil/host.h and replace the text inttypes.h by cinttypes.

Done, the replace work fine. Which is the better solution?
__STDC_FORMAT_MACROS in configure or the replace?
do the 2 solution change something in the ocr by tesseract?
thanks

do the 2 solution change something in the ocr by tesseract?

No.

Done, the replace work fine. Which is the better solution?
__STDC_FORMAT_MACROS in configure or the replace?

I think using cinttypes is the better solution for C++ code like it is used in Tesseract.

I prepared definitions of Docker containers and scripts that helps to compile and run Tesseract 4, take look at this: https://github.com/tesseract-shadow/tesseract-ocr-compilation

@wildloop Thanks!
I have added the info on wiki page at https://github.com/tesseract-ocr/tesseract/wiki/4.0-Dockerfile

I have successful build on Centos:   7.3.1611
please reference: https://ivanzz1001.github.io/records/post/ocr/2017/09/08/tesseract-install

@zdenop, please close this issue.


git config issue on Raspbian Squeeze

When cloning to Raspbian Squeeze, Git complains of this setting:
[push]
	default = simple

The simple option is default in Git 2.0. Probably it's unknown to older Git on Raspbian.  Might want to make it upstream since my workflow is compatible anyway.

not an issue in Raspbian Stretch (has git 2.11.0)
need to consider if this should be fixed for obsolete/old Squeeze (which I do still use on smaller SD cards), or just ignore it.  However I fix it, it will need to look for the git version and only fix if required.


📓 Added HUN translation

@KristofKekesi Looks good! Thank you for doing this. You may remove the _TODO comment if you'd like as well in this translation file.


As a developer or data scientist, I want to read documentation on how to get started with python notebooks in this repo so that I can play with the data and related code myself.

Description
We need documentation on our python notebooks and data pipeline so that data scientists can read, use, and/or integrate with our notebooks and data.
Solution
Beginner-friendly documentation in this github repo, geared towards data scientists and developers.
Describe alternatives you've considered
No documentation, which would be a poor decision for empowering the community.
Links to user research or other resources
Tasks
Definition of "Done"

[ ] Documentation PR submitted, reviewed, and merged

Please add documentation to the score directory, either in the README.md or in a new docs subdirectory.

How can we make this more usable by and incorporate feedback from EJ data experts?

Public usability and moving from data to conclusion as quickly as possible. Having point and click methods will make this more accessible than Jupyter notebooks. Usability vs usefulness of the data. The client will be very interactive but how can we improve this open source data analysis stage? What's the middle ground that makes this as usable as possible without getting into client roadmap development?
Ideas for usable components:

R/Shiny dashboard with point and click tooling
Simple mapbox/leaflet integration to see things and drag them around
Add some of this to the Jupyter notebooks themselves, maybe some way to have a GUI on a notebook
Make sure even the jupyter notebook portion is dockerized, because dealing with dependencies can cause headaches; clear documentation to get the notebook running

Ideas for use:

Use some of these components in user feedback sessions with EJ experts to discuss and get feedback on the data

Building on the suggestion from @clayton-aldern for making jupyter notebooks interactive. I've done some work with Binder which rebuilds your repo using a docker container and makes python notebooks within it executable. It can take 5+ minutes to rebuild and could be longer since we have quite a bit in this repo in addition to the iPython notebooks, but I believe it is an open source project -- so an alternative to Google if we wanted to avoid vendor lock-in.
Here's a tutorial on how to leverage Binder for Python jupyter notebooks.

Reflecting a bit more on the above, @switzersc-usds + @widal001. Right, I'm wondering if there's a world in which we can cut out some steps for data scientists or EJ advocates who want to play around with some data/code here but don't necessarily want to run a notebook locally. I forgot about Binder! It's awesome (if perhaps a little clunky?). @widal001, do you know if you can push notebook changes in a Binder instance back to GitHub? One advantage of the Colab approach is you can keep the notebooks checked in to version control. Anyway, maybe the broader point here is that maybe we could add some documentation around this kind of thing for folks who'd rather just explore in the browser? Offer a couple options?

Re: #198 more generally, the other thing that comes immediately to mind on the documentation front would be a tutorial in the README.md file (i.e. the one in score) that illustrates some use cases of that directory for data scientists? More of a 'here's why you might want to play around in this section of the repo', as opposed to only 'here's how to do it'. Might also help narrow the scope of the score directory for open-source folks?

+1 to the suggestion for explaining why someone might want to play with the code in the score directory. I've also found documentation within the notebooks can be helpful as a mechanism for stating the assumptions that underlie a model or for providing context or guidance necessary to interpret the results of a model.
In addition to stating the underlying assumptions, notebooks can be leveraged to inspire confidence in the data cleaning and modeling scripts by making select unit tests of the code more discoverable as well. There are a few ways of doing this, but ipytest is a reasonably mature package that leverages the existing pytest tests that are defined within the notebook. Another, simpler option would be to use the ! command within a cell to execute a shell command like !pytest which would output pytest results to the notebook. More discussion of these strategies can be found on this stack exchange thread
RE: Committing changes that people make to the interactive jupyter notebooks. This isn't possible through Binder since all of the changes are hosted in a Docker container that then gets destroyed after someone ends the session. I view this as an advantage since it prevents any accidental contributions to the repo that might be possible if edits to a Colab were allowed to be committed (even as a copy), and ensures that all changes continue to follow the guidelines in CONTRIBUTING.md. That being said, if it's possible to isolate changes from Colab to a branch, I can imagine a use case where that kind of less structured contributions would be valuable.

I might be misunderstanding the use case of playing around w/ the data, but I'm curious how many data advocates and researchers would prefer using a docker container over just installing the libraries and downloading locally.
I am only raising the question to limit potential future documentation updates.


Selfie Segmentation triggers alert on failure: Failed to create WebGL canvas context when passing video frame

Please make sure that this is a bug and also refer to the troubleshooting, FAQ documentation before raising any issues.
System information (Please provide as much relevant information as possible)

Have I written custom code (as opposed to using a stock example script provided in MediaPipe): No
OS Platform and Distribution (e.g., Linux Ubuntu 16.04, Android 11, iOS 14.4): Windows 10
Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
Browser and version (e.g. Google Chrome, Safari) if the issue happens on browser: Chrome
Programming Language and version ( e.g. C++, Python, Java): JS
MediaPipe version: 0.1.1628007100
Bazel version (if compiling from source): -
Solution ( e.g. FaceMesh, Pose, Holistic ): Selfie Segmentation
Android Studio, NDK, SDK versions (if issue is related to building in Android environment): -
Xcode & Tulsi version (if issue is related to building for iOS): -

Describe the current behavior:
If a certain failure occurs, the browser shows an alert. From selfie_segmentation.js:
alert("Failed to create WebGL canvas context when passing video frame.")

Describe the expected behavior:
Errors should be returned via the API and not displayed via an alert.

Hi @schontz, Could you please provide the steps to reproduce the above error. Thanks!

I haven't found the root cause, but the fact that there's an alert in the source code is the issue.
Here's the relevant section from selfie_segmentation.js (pretty-printed):
          case 7:
            d.l = document.createElement('canvas');
            q = d.l.getContext('webgl2', {});
            if (!q && ((q = d.l.getContext('webgl', {})), !q))
              return (
                alert('Failed to create WebGL canvas context when passing video frame.'), l.return()
              );
            d.C = q;
            d.h.canvas = d.l;
            d.h.createContext(d.l, !0, !0, {});

There should be no alerts in public code. Logging an error and throwing it would make sense (if you cannot recover).

Agreed. Will probably remove the alert and throw.  No time frame at the moment.

Can you give any background on why this might occur? It seems to fail getting the context from the canvas. I'm not sure how that would fail.

I'm also running into the same issue rn, any way to fix it? (if more info is required just ask me)

Ok, so I did some experimenting, and found out it could have something to do with the browser, I mean, I use opera GX by default, and it does give me the Failed to create WebGL canvas context when passing video frame error, but when you open the website in chrome, it works all fine for me

Ok, so I did some experimenting, and found out it could have something to do with the browser, I mean, I use opera GX by default, and it does give me the Failed to create WebGL canvas context when passing video frame error, but when you open the website in chrome, it works all fine for me. Edit: I just restarted my computer, and it sudently works now on my opera GX now too

In fact in Chrome latest version, the same error still exists.

I am using Selfie Segmentation in electron js application. I am also seeing alert "failed to create webgl canvas context when passing video frame electron" and error in console "Uncaught (in promise) TypeError: Cannot read property "loadGraph" of undefined"
Not able to figure out what is causing this error and alert.

Any update?

In my environment, this error stopped occurring after reinstalling the GPU device driver.
This error seems to occur when getContext('webgl2') fails.
And getContext('webgl2') fails if the browser cannot use webgl2.
Please open the following address in chrome.

chrome://gpu

If you are seeing this error, WebGL2 may be disabled in your environment.
I do not know why WebGL is not enabled in your browser, but I recommend that you check your device driver installation and settings around graphics.

Hello @schontz,
We are upgrading the MediaPipe Legacy Solutions to new MediaPipe solutions However, the libraries, documentation, and source code for all the MediaPipe Legacy Solutions will continue to be available in our GitHub repository and through library distribution services, such as Maven and NPM.
You can continue to use those legacy solutions in your applications if you choose. Though, we would request you to check new MediaPipe solutions which can help you more easily build and customize ML solutions for your applications. These new solutions will provide a superset of capabilities available in the legacy solutions.

Hi, I'm getting this same error on Chrome when I'm using some custom shaders to render a 3D object on top of pose detection by Mediapipe. I tested it across browsers & devices and it is working fine on Firefox.

On the same device, when I try it multiple times on Chrome, it works sometimes & throws this alert the other times.
On many other devices, it works easily on Chrome as well.

@schontz @kuaashish Were you able to find a fix for this?
I'm not using new Mediapipe solutions. Is it fixed there ?

The only solution I know is to override alert:
const realAlert = window.alert.bind(window);
window.alert = (message) => {
  if (message === "Failed to create WebGL canvas context when passing video frame.") return
  return realAlert(message);
}


Add v0.12 and iojs to build matrix

Coverage remained the same at 100.0% when pulling 4a1a51cbc7a72d3e8c33cc23c0ed8fb923b9162a on feature/v0.12 into 6f533ec57e2bc4418eca74f4e401d114fa5189d6 on master.

Coverage remained the same at 100.0% when pulling f66abafaf99ec3b2d56b3e12e3e5d6559138d56e on feature/v0.12 into 6f533ec57e2bc4418eca74f4e401d114fa5189d6 on master.


Bump pinned version numbers

Hi! This is the friendly automated conda-forge-linting service.
I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.


Fix notes for iNat import with no description

Sets notes to { } rather than "".
Delivers #2465 See generally https://mushroomobserver.slack.com/archives/C040TH9FV/p1728241575372789

coverage: 93.47%. remained the same
when pulling 0d30df31ec681b5059a6f155de9cf7e57c6516e4 on jdc-2465-inat-empty-notes
into fc3e9337d56da02e1b078c6c992dba282f613193 on main.


Keyboard layout to be fixed, SD card recognition after reset

Hello, using current 1.03 versions of MOS and VDP and I noticed a few flaws:
— presently the keyboard has quote (") and at (@) characters mutually swapped. Could be possible to fix this? It's rather irritating
— no tilde (~) character present, which is replaced by space
— SD card (mass storage) is properly recognized after it is inserted only when MOS is already running. But directly after reset Agon always complains "no valid FAT filesystem". Could be possible to enforce SD card detection (and mounting, if present) after each reset?
And a question: when doing VDP upgrade 1.02->1.03 in Arduino IDE, at the end of programming it said "going to enforce RTS reset" (or something like this) — but in the end it reported nothing more, like it was unable to do that reset by itself (I waited quite long). Is it normal?

Before I address your questions, you should note that there has been several updates both to MOS and the VDP that change behaviour a bit, so you may wish to update.
On your first query, you can change the keyboard layout.  The default is for a British keyboard.  If you have a US keyboard from the MOS command prompt you'll need to type SET KEYBOARD 1.  NB this command is currently case sensitive.  Many people have an AUTOEXEC.TXT file on the root of their SD card that includes such a command.
The tilde character works for me when I have the correct keyboard set.
Currently the SD card can't be ejected or re-mounted.  There is a pull request for MOS that adds a MOUNT commands, as well as some other useful additions.  Until that has been merged, the only way to re-mount an SD card is to press the reset button.

Oh, so… US keyboard is in much more common use, then I assumed it is the default and the swapped characters are a flaw. OK, thanks — at the moment I'll save myself with that autoexec tip.
I noticed one more flaw regarding SD cards: Agon is unable to use older, small SD cards of 1 GB size (which would be more than enough for 8-bit computer). Whatever I will set (tried every possible combination) as FAT-type and cluster size — Agon all the time complains „no valid FAT filesystem” (4 GB and 8 GB are „seen” OK).
I'm aware these smaller cards are slowly coming out of use, still it may mean some flaw in filesystem implementation, that may have also other negative consequences.

Hi @ZbigniewB thank you for your comments.

As suggested, use the SET KEYBOARD statement in the autoexec.txt to set the default keyboard on start
The SD card mounting is done on reset automatically, but not when a card is inserted during normal operation
The VDP reset should be automatic after upload. This is a function of the Arduino IDE / ESP32 tools, not the VDP software
Support for older cards is limited due to their class / speed a class 10 is recommended, though slower ones may work

If you are happy with these answers I'll mark this card as 'Won't Do' (no software mods required).

Well OK — if you think it's not related to any bug, I'm fine. Thanks for your prompt reply!


[GUIDE] Installation and usage guide for musicians

This guide is written because the README is not very detailed as to how to install and use this code base. I managed to figure things out on my own but a guide would be nice in my opinion.
Also the code look like it's being refractorized, so this guide serves only for the original state of the code.
Installation for track separation only
Warning: The repository supports Linux and does not support Windows (MacOS untested).
Setup git-lfs first. You will need it to download the models inside this repository.
You'd also need conda.
After all those are installed, clone the leaderboard_B branch:
git clone -b leaderboard_B https://github.com/kuielab/mdx-net-submission.git

In the cloned repository directory, do
conda env create -f environment.yml -n mdx-submit
conda activate mdx-submit
pip install -r requirements.txt
pip install demucs==2.0.3
python download_demucs.py

Onnxruntime currently does not have a version for python 3.10, so conda and pip will fail to install it. If you encounter this problem, just do
conda install python=3.9
pip install onnxruntime

And you're good.
Also, every time when you open a new terminal, conda will default to environment base.
Just do
conda activate mdx-submit

to go back into the environment you have installed MDX's dependencies in.
Usage
To go through all these hoops to install this AI demixer, you are probably looking for the best vocal separation result (for other stems you'd be better off with demucs v3). Here's an even better vocal model trained by UVR team to replace ./onnx/vocals.onnx with.
After successful installation, you can put the songs you wish to separate as ./data/test/SONGNAME/mixture.wav, and run either run.sh or
python predict_blend.py

After the separation completes, the results will be saved in ./data/results/baseline/SONGNAME/.

Hi @Zokhoi , Thank you for writing this valuable document.
I can revise README.md directly, but I think it would be better if you make a pull request to this repository, as an official contributor (if you want).

Thanks for the reply. As it seems that you are busy with another project at the moment, and that the different branches need to be updated separately, I would like to have a collaborator role for potentially less work.

Closing this as the README of the branches have been updated.


Using Portainer with Traefik

It's a Bug
What did you do?
Here is the way to run Portainer without traefik.
In traefik dashboard it looks normal:

frontend-Host-nightshift-tk-PathPrefixStrip-tool-portainer
backend-tool-portainer

But in the logs, docker service logs -f proxy_traefik there is NO mention of tool-portainer. Now I'm clueless!
What did you expect to see?
Access Portainer normally. It worked with Traefik:1.2.3
What did you see instead?
Stocked on the login screen
Output of traefik version: (What version of Traefik are you using?)
I use the image containous/traefik:f275e4ad3c0a660aa8170d0f5f709df5a9f7ebf4
I tested it with @dtomcej regarding the redirect bug from http to https.
What is your environment & configuration (arguments, toml, provider, platform, ...)?
See all my configs, toml, other container at:
https://github.com/pascalandy/docker-stack-this/tree/edge-acme/traefik-manager
Thank you!

I encountered this problem as well. I "solved" it by using an extra forward slash at the end in the browser and didn't look into it any further.

The PathStrip issue was fixed with version 1.3. I don't think it's related. All my other containers are working normally. It's really about portainer.

Works great for me with 1.3.1, so I would recommend to upgrade traefik and see if it fixes it.

I'll close this issue, because I think the question is answered, but feel free to continue the conversation.

All good @ldez !


[varlib.instancer] ital axis STAT table special-casing?

From the spec:

The 'ital' axis tag is used within a STAT table of italic fonts to provide a complete characterization of a font in relation to its family within the STAT table.

When I use varLib.instancer to split a variable font which has an ital axis into Foo-VF.ttf (ital=0) and Foo-Italic-VF.ttf (ital=1), the ital axis is dropped from the STAT table - fair enough, because it's no longer in the fvar table. But ital is a somewhat magical axis, for the purposes of the STAT table, to link between roman and italic fonts. So I think it should be special-cased and retained by the instancer even if it no longer appears in the fvar table.

makes sense. PR?

hm wait but.. I think we never drop any STAT design axes, we only prune AxisValue records when they don't match exactly the requested pinned location, see:
https://github.com/fonttools/fonttools/blob/445108f735b22a5ca37f669808d47906d024fe24/Lib/fontTools/varLib/instancer/__init__.py#L1038-L1039

maybe your font hits this and the whole STAT is dropped because no AxisValue at all?
https://github.com/fonttools/fonttools/blob/445108f735b22a5ca37f669808d47906d024fe24/Lib/fontTools/varLib/instancer/__init__.py#L1015-L1018


Failed to build the project for iOS Simulator

I'm facing the following issues while building the starter project for iOS Simulator.
error (xcode): building for ios simulator, but linking in object file built for ios, file '/users/vinothvino/documents/ensembleui/starter/ios/pods/googlemaps/base/frameworks/googlemapsbase.framework/googlemapsbase' for architecture arm64

Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)

Could not build the application for the simulator.
Error launching application on iPhone 14.

Steps to reproduce

Clone the project
Run flutter create . command
Run the project

flutter doctor -v
 starter git:(main) ✗ flutter doctor -v
[✓] Flutter (Channel stable, 3.10.5, on macOS 13.4.1 22F82 darwin-arm64, locale en-IN)
    • Flutter version 3.10.5 on channel stable at /Users/vinothvino/Developer/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (10 days ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/vinothvino/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • ANDROID_HOME = /Users/vinothvino/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/vinothvino/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

[✓] VS Code (version 1.79.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.66.0

[✓] Connected device (3 available)
    • iPhone 14 (mobile) • A9D28028-575F-4D7F-948C-B7795E9EC961 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
    • macOS (desktop)    • macos                                • darwin-arm64   • macOS 13.4.1 22F82 darwin-arm64
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 114.0.5735.133

[✓] Network resources
    • All expected network resources are available.

• No issues found!

It is fixed in this PR - #25


Add maturity assessment for Kvrocks

Some numbers need to update before discussion in the community.

[ ] PRs / Issues
[ ] Release Managers
[ ] Committers / PMCs

wow, thanks for @PragmaTwice carefully review.

Make a screenshot?

This page is under the root dir,

Oh, did not notice it.
BTW, should we also change PMC to PPMC in this PR?

Has filed another PR #84 to fix this.

BTW, should we also change PMC to PPMC in this PR?
Done

before discussion in the community

Shall we convert it to draft and send a discussion to dev@ or GH Discussion then?


Remove Project Nodes from Main menu

Description
Following a discussion with ZJ, it was decided its best to take off project nodes as a high level menu item.
Epic/Story
No response
Have you provided an initial effort estimate for this issue?
I have provided an initial effort estimate

Hi @Hasmin-AC, just for the sake of keeping everything documented, would you mind sharing the reasoning behind this decision here? Thanks in advance!


WIP: A proof-of-concept implementation for lazy tensor.

Not to be merged obviously.

@bgogul Let's close this PR?

@burmako done.


Unable to calculate cost of some charges

I have a few charges where the price will not be calculated. I am using Energinet to provide the prices and it oftens works, but in some cases it does not.
Here is the log from the attempt to calculate the cost for this single charge "452"
Any idea what is wrong?
dbug: TeslaMateAgile.PriceService[0]
      Updating prices
info: TeslaMateAgile.PriceHelper[0]
      Looking for finished charging processes with no cost set in the 'Home' geofence (id: 4)
info: TeslaMateAgile.PriceHelper[0]
      Calculating cost for charges 05/23/2023 13:33:21 UTC - 05/23/2023 15:00:10 UTC
dbug: TeslaMateAgile.PriceHelper[0]
      Retrieved 5 prices:
dbug: TeslaMateAgile.PriceHelper[0]
      05/23/2023 10:00:00 UTC - 05/23/2023 11:00:00 UTC: 0.87898751125
dbug: TeslaMateAgile.PriceHelper[0]
      05/23/2023 11:00:00 UTC - 05/23/2023 12:00:00 UTC: 0.69429999125
dbug: TeslaMateAgile.PriceHelper[0]
      05/23/2023 12:00:00 UTC - 05/23/2023 13:00:00 UTC: 0.52374999750
dbug: TeslaMateAgile.PriceHelper[0]
      05/23/2023 13:00:00 UTC - 05/23/2023 14:00:00 UTC: 0.51081250
dbug: TeslaMateAgile.PriceHelper[0]
      05/23/2023 14:00:00 UTC - 05/23/2023 15:00:00 UTC: 0.58975000250
info: TeslaMateAgile.PriceHelper[0]
      Phase correction: 2 -> 3
dbug: TeslaMateAgile.PriceHelper[0]
      Calculated charge cost for 05/23/2023 13:00:00 UTC - 05/23/2023 14:00:00 UTC (unit cost: 0.51081250, fee per kWh: 0): 2.4673334913608334581895300000 for 4.83021361333333357776 energy
dbug: TeslaMateAgile.PriceHelper[0]
      Calculated charge cost for 05/23/2023 14:00:00 UTC - 05/23/2023 15:00:00 UTC (unit cost: 0.58975000250, fee per kWh: 0): 6.4808319197627931300064801272 for 10.98911724000000005088 energy
fail: TeslaMateAgile.PriceHelper[0]
      Failed to calculate charging cost / energy for charging process 452
      System.Exception: Charge calculation failed, pricing calculated for 255 / 256, likely missing price data
         at TeslaMateAgile.PriceHelper.CalculateChargeCost(IEnumerable`1 charges) in /src/TeslaMateAgile/Helpers/PriceHelper.cs:line 127
         at TeslaMateAgile.PriceHelper.Update() in /src/TeslaMateAgile/Helpers/PriceHelper.cs:line 64
dbug: TeslaMateAgile.PriceService[0]
      Price update complete

I would love to do that. If only I knew how. Can you give me a short "how to"?

I've provided a short how to on another issue before, see if this helps if not I'll be happy to walk you through it: https://github.com/MattJeanes/TeslaMateAgile/issues/17#issuecomment-772895618

Never used pgAdmin before, or even logged into the database. But for some reason it just worked. Amazing. I have attached the .csv file. Let me know if it is not what you asked for.
data-1685037097905.csv

Nice! That's one part of what I need, the other is the entries from the charges table for that charging_process_id
The query should be SELECT * FROM charges WHERE charging_process_id = 452

Like so?
data-1685041452114.csv

That's perfect, thank you. I'll take a look and see what went wrong here.

Okay it looks very similar to an issue I recently-ish pushed a fix for with version v1.11.3
Can you verify that you're on that version? If you're on an older one I suspect that will be why 😄

That would be slightly embarrassing if I am not on the latest release. Let me double check that later when I get home.

Updated to latest release (1.11.3) and now all charges calculates correctly.

Great to hear, thanks for the confirmation! 🙂