问:
Installing Angular 13 Server side rendering gives dependency error
I am using Angular ~13.3.0 and @angular/material: ^13.3.9

I wanted to install the Server side rendering, So I ran the command

```<code>ng add @nguniversal/express-engine
</code>```

getting this error.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: ava-grid@0.0.0
npm ERR! Found: @angular/animations@13.3.11
npm ERR! node_modules/@angular/animations
npm ERR!   peer @angular/animations@"^13.0.0 || ^14.0.0-0" from @angular/material@13.3.9
npm ERR!   node_modules/@angular/material
npm ERR!     @angular/material@"^13.3.9" from the root project
npm ERR!   peerOptional @angular/animations@"13.3.11" from @angular/platform-browser@13.3.11
npm ERR!   node_modules/@angular/platform-browser
npm ERR!     peer @angular/platform-browser@"13.3.11" from @angular/forms@13.3.11
npm ERR!     node_modules/@angular/forms
npm ERR!       peer @angular/forms@"^13.0.0 || ^14.0.0-0" from @angular/material@13.3.9
npm ERR!       node_modules/@angular/material
npm ERR!         @angular/material@"^13.3.9" from the root project
npm ERR!       2 more (@ctrl/ngx-codemirror, the root project)
npm ERR!     peer @angular/platform-browser@"^13.0.0 || ^14.0.0-0" from @angular/material@13.3.9
npm ERR!     node_modules/@angular/material
npm ERR!       @angular/material@"^13.3.9" from the root project
npm ERR!     3 more (@angular/platform-browser-dynamic, @angular/router, the root project)
npm ERR!   1 more (the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! @nguniversal/express-engine@"13.1.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/animations@13.3.12
npm ERR! node_modules/@angular/animations
npm ERR!   peer @angular/animations@"13.3.12" from @angular/platform-server@13.3.12
npm ERR!   node_modules/@angular/platform-server
npm ERR!     peer @angular/platform-server@"^13.3.4" from @nguniversal/express-engine@13.1.1
npm ERR!     node_modules/@nguniversal/express-engine
npm ERR!       @nguniversal/express-engine@"13.1.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.```

I have no idea what is going on here as I am using material

Body:
I am using Angular ~13.3.0 and @angular/material: ^13.3.9

I wanted to install the Server side rendering, So I ran the command

ng add @nguniversal/express-engine

getting this error.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: ava-grid@0.0.0
npm ERR! Found: @angular/animations@13.3.11
npm ERR! node_modules/@angular/animations
npm ERR!   peer @angular/animations@"^13.0.0 || ^14.0.0-0" from @angular/material@13.3.9
npm ERR!   node_modules/@angular/material
npm ERR!     @angular/material@"^13.3.9" from the root project
npm ERR!   peerOptional @angular/animations@"13.3.11" from @angular/platform-browser@13.3.11
npm ERR!   node_modules/@angular/platform-browser
npm ERR!     peer @angular/platform-browser@"13.3.11" from @angular/forms@13.3.11
npm ERR!     node_modules/@angular/forms
npm ERR!       peer @angular/forms@"^13.0.0 || ^14.0.0-0" from @angular/material@13.3.9
npm ERR!       node_modules/@angular/material
npm ERR!         @angular/material@"^13.3.9" from the root project
npm ERR!       2 more (@ctrl/ngx-codemirror, the root project)
npm ERR!     peer @angular/platform-browser@"^13.0.0 || ^14.0.0-0" from @angular/material@13.3.9
npm ERR!     node_modules/@angular/material
npm ERR!       @angular/material@"^13.3.9" from the root project
npm ERR!     3 more (@angular/platform-browser-dynamic, @angular/router, the root project)
npm ERR!   1 more (the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! @nguniversal/express-engine@"13.1.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/animations@13.3.12
npm ERR! node_modules/@angular/animations
npm ERR!   peer @angular/animations@"13.3.12" from @angular/platform-server@13.3.12
npm ERR!   node_modules/@angular/platform-server
npm ERR!     peer @angular/platform-server@"^13.3.4" from @nguniversal/express-engine@13.1.1
npm ERR!     node_modules/@nguniversal/express-engine
npm ERR!       @nguniversal/express-engine@"13.1.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

I have no idea what is going on here as I am using material


来源: stackexchange

问:
android.database.sqlite.SQLiteBlobTooBigException: Row too big to fit into CursorWindow requiredPos=250, totalRows=251
App is crashing and giving this error -
android.database.sqlite.SQLiteBlobTooBigException: Row too big to fit into CursorWindow requiredPos=250, totalRows=251

and this is the DB query
@Query("SELECT * FROM "+ TABLE_NAME)
public abstract List getAllObjects();

is there any way i can fix it ?

ContentLicense: CC BY-SA 4.0


问:
Google markers not showing up
I want to use Google API to show route between A and B point and show all company's locations as marker. Showing route works well. But markers not displaying and showing no error.

Here is my code:

google.maps.event.addDomListener(window, "load", initMap);

function initMap() {
    //create map
    map = new google.maps.Map(document.getElementById("googleMap"), mapOptions);

    ContextMenu = document.getElementById("my-context-menu");
    google.maps.event.addListener(map, "rightclick", function (ev) {
        currentLatLng = ev.latLng;
        console.log(ev.latLng);
        ShowContextMenuGoolge(ContextMenu, ev);

        /** this stop NOT stopping DOM 'context-menu' event from firing */
        ev.stop();
    });

    google.maps.event.addListener(map, "click", function () {
        HideContextMenuGoolge(ContextMenu);
    });

    //create a DirectionsService object to use the route method and get a result for our request
    directionsService = new google.maps.DirectionsService();

    //create a DirectionsRenderer object which we will use to display the route
    directionsDisplay = new google.maps.DirectionsRenderer();

    //bind the DirectionsRenderer to the map
    directionsDisplay.setMap(map);

    $.ajax({
        type: "GET",
        url: getAllMarkers,
        success: function (res) {
            createMarker(res);
        },
        err: function (err) {},
    });
}

function createMarker(companies) {
    // console.log(map);
    companies.map((el) => {
        var marker = new google.maps.Marker({
            position: new google.maps.LatLng(el.lat, el.lng),
            map: map,
        });
        comMarkers.push(marker);
    });
    console.log(comMarkers);
}
```

This is result SS. Calculating route is works fine.

Thank for helping me.

Title: Google markers not showing up

Body:
I want to use Google API to show route between A and B point and show all company's locations as marker. Showing route works well. But markers not displaying and showing no error.

Here is my code:

google.maps.event.addDomListener(window, "load", initMap);

function initMap() {
    //create map
    map = new google.maps.Map(document.getElementById("googleMap"), mapOptions);

    ContextMenu = document.getElementById("my-context-menu");
    google.maps.event.addListener(map, "rightclick", function (ev) {
        currentLatLng = ev.latLng;
        console.log(ev.latLng);
        ShowContextMenuGoolge(ContextMenu, ev);

        /** this stop NOT stopping DOM 'context-menu' event from firing */
        ev.stop();
    });

    google.maps.event.addListener(map, "click", function () {
        HideContextMenuGoolge(ContextMenu);
    });

    //create a DirectionsService object to use the route method and get a result for our request
    directionsService = new google.maps.DirectionsService();

    //create a DirectionsRenderer object which we will use to display the route
    directionsDisplay = new google.maps.DirectionsRenderer();

    //bind the DirectionsRenderer to the map
    directionsDisplay.setMap(map);

    $.ajax({
        type: "GET",
        url: getAllMarkers,
        success: function (res) {
            createMarker(res);
        },
        err: function (err) {},
    });
}

function createMarker(companies) {
    // console.log(map);
    companies.map((el) => {
        var marker = new google.maps.Marker({
            position: new google.maps.LatLng(el.lat, el.lng),
            map: map,
        });
        comMarkers.push(marker);
    });
    console.log(comMarkers);
}

This is result SS. Calculating route is works fine.

Thank for helping me.


问:
Why does the array in my nested jquery Ajax post call returns undefined values?
I want to display 30+ graphs with Chart.js, each with different data, title, etc, without needing to write scripts for each of them. So, I want to iterate through the database-given ServiceId values.

```<code>    var ServiceId = [];
    var ServiceName = [];
    var ServiceDesc = [];

    $.post("data/GetServiceNames_data.php", function(data)
    {
        console.log(data);

        for (var i in data) {
            ServiceId.push(data[i].ServiceId);
            ServiceName.push(data[i].ServiceName);
            ServiceDesc.push(data[i].ServiceDesc);
        }

        for (var i = 0; i < ServiceId.length; i++){

            $.post("data/ServerStatuses_data.php", { 'ServiceId': ServiceId[i] },
                function (data)
                {
                    console.log(data);
                    var Timestamp = [];
                    var Status = [];
                    for (var i in data) {
                        Timestamp.push(data[i].Timestamp);
                        Status.push(data[i].status);
                    }
                    var chartdata = {
                        labels: Timestamp,
                        datasets: [
                            {
                                label: ServiceDesc[i],
                                backgroundColor: 'rgb(103, 161, 118)',
                                borderColor: 'rgb(100, 129, 120)',
                                hoverBackgroundColor: '#CCCCCC',
                                hoverBorderColor: '#666666',
                                data: Status,
                                borderWidth: 1
                            }
                        ]
                    };
                    var graphTarget = $("#ServerGraph"+ServiceId[i]);
                    console.log(graphTarget);
                    var barGraph = new Chart(graphTarget, {
                        type: 'line',
                        data: chartdata,
                        borderWidth: 1
                    });
                });

        }

    });

</code>```

Why does ServiceId[i] and ServiceDesc[i] in the second post call (the one calling "ServerStatuses_data.php") returns 'undefined' as its values?

If it's needed, ServerStatuses_data.php contains this

```<code>header('Content-Type: application/json');
$ServiceId = $_POST['ServiceId'];
$conn = mysqli_connect(env('DB_HOST'), env('DB_USERNAME'), env('DB_PASSWORD'),env('DB_NAME'));
$sqlQuery = "SELECT trans_status.run_time AS Timestamp, trans_status.status FROM trans_status WHERE trans_status.idservice =  " . $ServiceId . " AND `trans_status`.`run_time` >= '2023-01-01 00:00:01' AND `trans_status`.`run_time` <= '2023-01-02 23:59:59';";
$result = mysqli_query($conn,$sqlQuery);
$data = array();
foreach ($result as $row) {
    $data[] = $row;
}
mysqli_close($conn);
echo json_encode($data);
</code>```

Thank you.

Body:
I want to display 30+ graphs with Chart.js, each with different data, title, etc, without needing to write scripts for each of them. So, I want to iterate through the database-given ServiceId values.

    var ServiceId = [];
    var ServiceName = [];
    var ServiceDesc = [];

    $.post("data/GetServiceNames_data.php", function(data)
    {
        console.log(data);

        for (var i in data) {
            ServiceId.push(data[i].ServiceId);
            ServiceName.push(data[i].ServiceName);
            ServiceDesc.push(data[i].ServiceDesc);
        }

        for (var i = 0; i < ServiceId.length; i++){

            $.post("data/ServerStatuses_data.php", { 'ServiceId': ServiceId[i] },
                function (data)
                {
                    console.log(data);
                    var Timestamp = [];
                    var Status = [];
                    for (var i in data) {
                        Timestamp.push(data[i].Timestamp);
                        Status.push(data[i].status);
                    }
                    var chartdata = {
                        labels: Timestamp,
                        datasets: [
                            {
                                label: ServiceDesc[i],
                                backgroundColor: 'rgb(103, 161, 118)',
                                borderColor: 'rgb(100, 129, 120)',
                                hoverBackgroundColor: '#CCCCCC',
                                hoverBorderColor: '#666666',
                                data: Status,
                                borderWidth: 1
                            }
                        ]
                    };
                    var graphTarget = $("#ServerGraph"+ServiceId[i]);
                    console.log(graphTarget);
                    var barGraph = new Chart(graphTarget, {
                        type: 'line',
                        data: chartdata,
                        borderWidth: 1
                    });
                });

        }

    });

Why does ServiceId[i] and ServiceDesc[i] in the second post call (the one calling "ServerStatuses_data.php") returns 'undefined' as its values?

If it's needed, ServerStatuses_data.php contains this

header('Content-Type: application/json');
$ServiceId = $_POST['ServiceId'];
$conn = mysqli_connect(env('DB_HOST'), env('DB_USERNAME'), env('DB_PASSWORD'),env('DB_NAME'));
$sqlQuery = "SELECT trans_status.run_time AS Timestamp, trans_status.status FROM trans_status WHERE trans_status.idservice =  " . $ServiceId . " AND `trans_status`.`run_time` >= '2023-01-01 00:00:01' AND `trans_status`.`run_time` <= '2023-01-02 23:59:59';";
$result = mysqli_query($conn,$sqlQuery);
$data = array();
foreach ($result as $row) {
    $data[] = $row;
}
mysqli_close($conn);
echo json_encode($data);

Thank you.


问:
React-three local server suddenly stopped working
I'm working on a react-three project and everything seemed to be working fine. The problem is after a while, when I restart my dev server (yarn start) the react seems to not be loading.
When I console.log inside of the index.html file it does show up the console, so javascript seems to work. I have no error inside of my terminal, but I do get this error in the console:

I already tried reinstalling my modules, but it didn't fix anything. This this is the second time it has happend to me, and after a while I get tired of searching for the error and I just pull my project from git and copy paste my code, and everything works again...

Does anyone know what could be causing this issue?


问:
how to read environment variable start with $ in nodejs
My .env.staging file is node like this

```<code>ConnectionUser=test
Connectionpassword=$123aBc
ConnectionDatabase=asdf
</code>```

my server.js file is like this

```<code>console.log(process.env.ConnectionUser, "ConnectionUser")
console.log(process.env.Connectionpassword, "Connectionpassword")
</code>```

i am getting connectionuser but not getting Connectionpassword, it is blank

also tried this in env.staging with string but did not work

```<code>Connectionpassword='$123aBc'
</code>```

Body:
My .env.staging file is node like this

ConnectionUser=test
Connectionpassword=$123aBc
ConnectionDatabase=asdf

my server.js file is like this

console.log(process.env.ConnectionUser, "ConnectionUser")
console.log(process.env.Connectionpassword, "Connectionpassword")

i am getting connectionuser but not getting Connectionpassword, it is blank

also tried this in env.staging with string but did not work

Connectionpassword='$123aBc'


问:
Cannot change existdb-login.html
I am trying to change the login path /exist/app/ to /own-project/app/ in
dashboard-2.0.9/bower_components/existdb-launcher/existdb-login.html
but it fails with

The XML parser reported a problem: fatal error at (1,1236) : The element type "input" must be terminated by the matching end-tag "". XMLDB reported an exception while storing document: The XML parser reported a problem: fatal error at (1,1236) : The element type "input" must be terminated by the matching end-tag "".

Is it possible that exist does not accept its own scripts?
I know xml is stricter than html but it should be possible to save it(?)
Up to version 5.3.1 it also worked

Thanks!
Gordon

Title: Cannot change existdb-login.html


问:
FORECAST worksheet function not working - Unable to get Forecast property of worksheetfunction class
I am attempting to loop through columns forecasting data in VBA. When there were 3 columns, this worked originally, I expanded to 6 columns and it is now not functioning.
I also tried a variant using a single loop for the forecasting and using Select Case to loop through all the columns.

```<code>    Sub forecast_daily()

    'refresh values (specifically Today and matching index)
    Application.Calculation = xlCalculationManual
    Application.Calculation = xlCalculationAutomatic

    'set sheets

    Set wb = ThisWorkbook.Sheets("Daily Data")
    Set fc = ThisWorkbook.Sheets("Intake Forecasting Daily")

    ' define values

    Dim dates, newdates, EUSSIntake, JFMintake, lateintake, newjfmintake, convertintake, BNOintake,      Akinintake, Chenintake, ibtexintake, zambintake, velajintake As Range
     Dim i, j As Long
    Dim newdate As Double
    Dim Rownum, a As Integer
    Dim negcheck As Double
    Dim toggleB, toggleC, toggleD, toggleE, toggleF, toggleG As Boolean

    'Find empty row in EUSSIntake
    i = fc.Range("V3").Value
    'i equals empty row number

    newdate = Cells(i, 1)

    Set dates = Range("A22", "A" & (i - 1))
    Set EUSSIntake = Range("B22", "B" & (i - 1))

    'change starting point for JFM and BNO to account for blanks
    Set newdates = Range("A1065", "A" & (i - 1))
    Set JFMintake = Range("C1065", "C" & (i - 1))
    Set BNOintake = Range("D1065", "D" & (i - 1))

    'change start point for EUSS split (922)
    Set dates3 = Range("A922", "A" & (i - 1))
    Set lateintake = Range("E922", "E" & (i - 1))
    Set newjfmintake = Range("F922", "F" & (i - 1))
    Set convertintake = Range("G922", "G" & (i - 1))

    ' Loop Worksheet forecast function
    toggleB = True
    toggleC = True
    toggleD = True
    toggleE = True
    toggleF = True
    toggleG = True

    ' This is main loop - This originally worked! Frustrating now that it is isnt.
    While i < 3001
        If Cells(i - 1, 2) > -1000 And toggleB = True Then
        Cells(i, 2).Value = Application.WorksheetFunction.Forecast(newdate, EUSSIntake, dates)
        Else
        toggleB = False
        End If
        If Cells(i - 1, 3) > -1000 And toggleC = True Then
        Cells(i, 3).Value = Application.WorksheetFunction.Forecast(newdate, JFMintake, newdates)
        Else
        toggleC = False
        End If
        If Cells(i - 1, 4) > -1000 And toggleD = True Then
        Cells(i, 4).Value = Application.WorksheetFunction.Forecast(newdate, BNOintake, newdates)
        Else
        toggleD = False
        End If
        If Cells(i - 1, 5) > -1000 And toggleE = True Then
        Cells(i, 5).Value = Application.WorksheetFunction.Forecast(newdate, lateintake, dates3)
        Else
        toggleE = False
        End If
        If Cells(i - 1, 6) > -1000 And toggleF = True Then
        Cells(i, 6).Value = Application.WorksheetFunction.Forecast(newdate, newjfmintake, dates3)
        Else
        toggleF = False
        End If
        If Cells(i - 1, 7) > -1000 And toggleG = True Then
        Cells(i, 7).Value = Application.WorksheetFunction.Forecast(newdate, convertintake, dates3)
        Else
        toggleG = False
        End If

    ' increment i
        i = i + 1

    ' Update new values
       newdate = Cells(i, 1)

    Wend

    End Sub
</code>```

I have tried the usual reasons for this error. Newdate is passing in as a double, knownx and knowny and ranges of equal size for the forecast function. Im pulling my hair out that it worked 2 days ago and ive changed nothing and now its throwing the error.

Body:
I am attempting to loop through columns forecasting data in VBA. When there were 3 columns, this worked originally, I expanded to 6 columns and it is now not functioning.
I also tried a variant using a single loop for the forecasting and using Select Case to loop through all the columns.

    Sub forecast_daily()

    'refresh values (specifically Today and matching index)
    Application.Calculation = xlCalculationManual
    Application.Calculation = xlCalculationAutomatic

    'set sheets

    Set wb = ThisWorkbook.Sheets("Daily Data")
    Set fc = ThisWorkbook.Sheets("Intake Forecasting Daily")

    ' define values

    Dim dates, newdates, EUSSIntake, JFMintake, lateintake, newjfmintake, convertintake, BNOintake,      Akinintake, Chenintake, ibtexintake, zambintake, velajintake As Range
     Dim i, j As Long
    Dim newdate As Double
    Dim Rownum, a As Integer
    Dim negcheck As Double
    Dim toggleB, toggleC, toggleD, toggleE, toggleF, toggleG As Boolean

    'Find empty row in EUSSIntake
    i = fc.Range("V3").Value
    'i equals empty row number

    newdate = Cells(i, 1)

    Set dates = Range("A22", "A" & (i - 1))
    Set EUSSIntake = Range("B22", "B" & (i - 1))

    'change starting point for JFM and BNO to account for blanks
    Set newdates = Range("A1065", "A" & (i - 1))
    Set JFMintake = Range("C1065", "C" & (i - 1))
    Set BNOintake = Range("D1065", "D" & (i - 1))

    'change start point for EUSS split (922)
    Set dates3 = Range("A922", "A" & (i - 1))
    Set lateintake = Range("E922", "E" & (i - 1))
    Set newjfmintake = Range("F922", "F" & (i - 1))
    Set convertintake = Range("G922", "G" & (i - 1))

    ' Loop Worksheet forecast function
    toggleB = True
    toggleC = True
    toggleD = True
    toggleE = True
    toggleF = True
    toggleG = True

    ' This is main loop - This originally worked! Frustrating now that it is isnt.
    While i < 3001
        If Cells(i - 1, 2) > -1000 And toggleB = True Then
        Cells(i, 2).Value = Application.WorksheetFunction.Forecast(newdate, EUSSIntake, dates)
        Else
        toggleB = False
        End If
        If Cells(i - 1, 3) > -1000 And toggleC = True Then
        Cells(i, 3).Value = Application.WorksheetFunction.Forecast(newdate, JFMintake, newdates)
        Else
        toggleC = False
        End If
        If Cells(i - 1, 4) > -1000 And toggleD = True Then
        Cells(i, 4).Value = Application.WorksheetFunction.Forecast(newdate, BNOintake, newdates)
        Else
        toggleD = False
        End If
        If Cells(i - 1, 5) > -1000 And toggleE = True Then
        Cells(i, 5).Value = Application.WorksheetFunction.Forecast(newdate, lateintake, dates3)
        Else
        toggleE = False
        End If
        If Cells(i - 1, 6) > -1000 And toggleF = True Then
        Cells(i, 6).Value = Application.WorksheetFunction.Forecast(newdate, newjfmintake, dates3)
        Else
        toggleF = False
        End If
        If Cells(i - 1, 7) > -1000 And toggleG = True Then
        Cells(i, 7).Value = Application.WorksheetFunction.Forecast(newdate, convertintake, dates3)
        Else
        toggleG = False
        End If

    ' increment i
        i = i + 1

    ' Update new values
       newdate = Cells(i, 1)

    Wend

    End Sub

I have tried the usual reasons for this error. Newdate is passing in as a double, knownx and knowny and ranges of equal size for the forecast function. Im pulling my hair out that it worked 2 days ago and ive changed nothing and now its throwing the error.


问:
Is there a way to have a list where each item has an optional dropdown, that overlaps the list items below it?
I am trying to make a list of Entry fields that is loaded N times, with some text and comments together.

This is my layout

And when the text is typed I am trying to make a suggestion of text back from a predefined text collection but, the suggestion layout push all the controls below but not get over top.

This is how the suggested text will look like

I tried using absolute layout but actually cannot get what I am wanting. Each Enter Text has its suggestion and since there can be N times. So I want to fix it for all some text. And all have different text suggestion length.

```<code><StackLayout BindableLayout.ItemsSource="{Binding MyTextList}"  VerticalOptions="FillAndExpand">
      <BindableLayout.ItemTemplate>
            <DataTemplate>
                  <Frame Margin="0,10,0,10" Padding="0" HasShadow="False" BackgroundColor="Transparent">
                        <Grid Margin="20">
                             <Grid.ColumnDefinitions>
                                   <ColumnDefinition Width="*" ></ColumnDefinition>
                                   <ColumnDefinition Width="*"></ColumnDefinition>
                             </Grid.ColumnDefinitions>
                             <StackLayout Orientation="Vertical" Grid.Column="0" Grid.Row="0" HorizontalOptions="FillAndExpand">
                                  <AbsoluteLayout VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
                                       <Grid Margin="0" AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1">
                                             <Grid.RowDefinitions>
                                                   <RowDefinition Height="auto" ></RowDefinition>
                                                   <RowDefinition Height="*"></RowDefinition>
                                             </Grid.RowDefinitions>
                                           <Label Text="{x:Static Rec:VestParkResource.SomeText}" TextColor="Black" FontAttributes="Bold" Grid.Column="0" Grid.Row="0" />
                                           <Frame Grid.Column="0" Grid.Row="1" Padding="5"
                                             BorderColor="{StaticResource GrayBorderColor}" CornerRadius="30"
                                             HeightRequest="55" HorizontalOptions="FillAndExpand" >
                                                 <controls:BorderlessEntry TextTransform="Uppercase"
                                                         Text="{Binding Text}"
                                                         Index = "{Binding Index}"
                                                         TextChanged ="SuggestShow" Completed="SuggestShow"
                                                         MaxLength="50" x:Name="LicensePlate" Keyboard="Text"
                                                         Placeholder="{x:Static Rec:VestParkResource.SomeText}"
                                                         FontFamily="OpenSansRegular" />
                                          </Frame>
                                    </Grid>
                                    <StackLayout BindableLayout.ItemsSource="{Binding SuggestedText}" BindableLayout.EmptyView="No Suggestions"
                                          x:Name="SuggestedTextView"  Orientation="Vertical" IsVisible="{Binding IsVisible}"
                                          BackgroundColor="White"
                                          AbsoluteLayout.LayoutBounds="0,65,1,1" AbsoluteLayout.LayoutFlags="None">
                                         <BindableLayout.ItemTemplate>
                                               <DataTemplate>
                                                     <StackLayout BackgroundColor="White" Padding="5" Margin="0" >
                                                           <Label Text="{Binding .}" FontSize="16" TextColor="#FF464859"/>
                                                     </StackLayout>
                                               </DataTemplate>
                                          </BindableLayout.ItemTemplate>
                                     </StackLayout>
                                  </AbsoluteLayout>
                             </StackLayout>
                             <StackLayout Grid.Column="1" Grid.Row="0" Orientation="Vertical"  HorizontalOptions="FillAndExpand">
                                    <Grid Margin="0">
                                           <Grid.RowDefinitions>
                                                 <RowDefinition Height="auto" ></RowDefinition>
                                                 <RowDefinition Height="*"></RowDefinition>
                                           </Grid.RowDefinitions>
                                           <Label Text="{x:Static Rec:VestParkResource.Comment}" TextColor="Black" FontAttributes="Bold" Grid.Column="0" Grid.Row="0" />
                                           <Frame Grid.Column="0" Grid.Row="1" Padding="5" HasShadow="False" BorderColor="{StaticResource GrayBorderColor}" CornerRadius="30" HeightRequest="55" HorizontalOptions="FillAndExpand">
                                                   <controls:BorderlessEntry
                                                             TextTransform="Uppercase"
                                                             Text="{Binding Comment}"
                                                             MaxLength="50" x:Name="Comment" Keyboard="Text"
                                                             Placeholder="{x:Static Rec:VestParkResource.Comment}"
                                                             FontFamily="OpenSansRegular" />
                                            </Frame>
                                    </Grid>
                             </StackLayout>
                     </Grid>
              </Frame>
           </DataTemplate>
       </BindableLayout.ItemTemplate>
</StackLayout>
</code>```

I have tried different combination of Absolute Layout's LayoutFlags and LayoutBounds but cannot achieve what I want. Can any one how can I achieve it? If it is possible using something other than absolute layout then please suggest.

Body:
I am trying to make a list of Entry fields that is loaded N times, with some text and comments together.

This is my layout

And when the text is typed I am trying to make a suggestion of text back from a predefined text collection but, the suggestion layout push all the controls below but not get over top.

This is how the suggested text will look like

I tried using absolute layout but actually cannot get what I am wanting. Each Enter Text has its suggestion and since there can be N times. So I want to fix it for all some text. And all have different text suggestion length.

<StackLayout BindableLayout.ItemsSource="{Binding MyTextList}"  VerticalOptions="FillAndExpand">
      <BindableLayout.ItemTemplate>
            <DataTemplate>
                  <Frame Margin="0,10,0,10" Padding="0" HasShadow="False" BackgroundColor="Transparent">
                        <Grid Margin="20">
                             <Grid.ColumnDefinitions>
                                   <ColumnDefinition Width="*" ></ColumnDefinition>
                                   <ColumnDefinition Width="*"></ColumnDefinition>
                             </Grid.ColumnDefinitions>
                             <StackLayout Orientation="Vertical" Grid.Column="0" Grid.Row="0" HorizontalOptions="FillAndExpand">
                                  <AbsoluteLayout VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
                                       <Grid Margin="0" AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1">
                                             <Grid.RowDefinitions>
                                                   <RowDefinition Height="auto" ></RowDefinition>
                                                   <RowDefinition Height="*"></RowDefinition>
                                             </Grid.RowDefinitions>

                                           <Frame Grid.Column="0" Grid.Row="1" Padding="5"
                                             BorderColor="{StaticResource GrayBorderColor}" CornerRadius="30"
                                             HeightRequest="55" HorizontalOptions="FillAndExpand" >
                                                 <controls:BorderlessEntry TextTransform="Uppercase"
                                                         Text="{Binding Text}"
                                                         Index = "{Binding Index}"
                                                         TextChanged ="SuggestShow" Completed="SuggestShow"
                                                         MaxLength="50" x:Name="LicensePlate" Keyboard="Text"
                                                         Placeholder="{x:Static Rec:VestParkResource.SomeText}"
                                                         FontFamily="OpenSansRegular" />
                                          </Frame>
                                    </Grid>
                                    <StackLayout BindableLayout.ItemsSource="{Binding SuggestedText}" BindableLayout.EmptyView="No Suggestions"
                                          x:Name="SuggestedTextView"  Orientation="Vertical" IsVisible="{Binding IsVisible}"
                                          BackgroundColor="White"
                                          AbsoluteLayout.LayoutBounds="0,65,1,1" AbsoluteLayout.LayoutFlags="None">
                                         <BindableLayout.ItemTemplate>
                                               <DataTemplate>
                                                     <StackLayout BackgroundColor="White" Padding="5" Margin="0" >

                                                     </StackLayout>
                                               </DataTemplate>
                                          </BindableLayout.ItemTemplate>
                                     </StackLayout>
                                  </AbsoluteLayout>
                             </StackLayout>
                             <StackLayout Grid.Column="1" Grid.Row="0" Orientation="Vertical"  HorizontalOptions="FillAndExpand">
                                    <Grid Margin="0">
                                           <Grid.RowDefinitions>
                                                 <RowDefinition Height="auto" ></RowDefinition>
                                                 <RowDefinition Height="*"></RowDefinition>
                                           </Grid.RowDefinitions>

                                           <Frame Grid.Column="0" Grid.Row="1" Padding="5" HasShadow="False" BorderColor="{StaticResource GrayBorderColor}" CornerRadius="30" HeightRequest="55" HorizontalOptions="FillAndExpand">
                                                   <controls:BorderlessEntry
                                                             TextTransform="Uppercase"
                                                             Text="{Binding Comment}"
                                                             MaxLength="50" x:Name="Comment" Keyboard="Text"
                                                             Placeholder="{x:Static Rec:VestParkResource.Comment}"
                                                             FontFamily="OpenSansRegular" />
                                            </Frame>
                                    </Grid>
                             </StackLayout>
                     </Grid>
              </Frame>
           </DataTemplate>
       </BindableLayout.ItemTemplate>
</StackLayout>

I have tried different combination of Absolute Layout's LayoutFlags and LayoutBounds but cannot achieve what I want. Can any one how can I achieve it? If it is possible using something other than absolute layout then please suggest.


问:
Error importing the stopwords from nltk library in jupyter notebook
I am a beginner in NLP and trying to use the nltk.download('stopwords') but i am getting an invalid url error, i also tried other answers as well but i am not getting any viable solution.

```<code>import nltk

nltk.download('stopwords')
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
set(stopwords.words('english'))
</code>```

I am getting this error:-

```<code>InvalidURL: URL can't contain control characters. 'SYSTEM PROXY' (found at least ' ')
</code>```

Body:
I am a beginner in NLP and trying to use the nltk.download('stopwords') but i am getting an invalid url error, i also tried other answers as well but i am not getting any viable solution.

import nltk

nltk.download('stopwords')
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
set(stopwords.words('english'))

I am getting this error:-

InvalidURL: URL can't contain control characters. 'SYSTEM PROXY' (found at least ' ')


问:
Apache Flink 1.13.5 and JDK11 : Could not deserialize inputs error
Flink Version: 1.13.5

JDK version: 11

Jackson version: 2.13.1

Avro Serializer version: 6.1.1

Kafka Clients version: 3.1.0

HighAvailability: Enabled

Deployed on Kubernetes. Deleted all previous checkpoints.

The application runs fine on Flink 1.12.4 with both JDK 8 and 11. However, once I upgrade to 1.13.5 on JDK 11, I encounter this error. Not sure how to fix it. Any help is appreciated. Thank you.

```<code>switched from INITIALIZING to FAILED with failure cause: org.apache.flink.streaming.runtime.tasks.StreamTaskException: Could not deserialize inputs
at org.apache.flink.streaming.api.graph.StreamConfig.getInputs(StreamConfig.java:274)
at org.apache.flink.streaming.api.graph.StreamConfig.getTypeSerializerIn(StreamConfig.java:289)
at org.apache.flink.streaming.api.graph.StreamConfig.getTypeSerializerIn1(StreamConfig.java:280)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.wrapOperatorIntoOutput(OperatorChain.java:691)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:637)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:619)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:619)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:619)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:619)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:619)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:619)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:619)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:619)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.<init>(OperatorChain.java:186)
at org.apache.flink.streaming.runtime.tasks.StreamTask.executeRestore(StreamTask.java:551)
at org.apache.flink.streaming.runtime.tasks.StreamTask.runWithCleanUpOnFail(StreamTask.java:650)
at org.apache.flink.streaming.runtime.tasks.StreamTask.restore(StreamTask.java:540)
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:759)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:566)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.io.InvalidClassException: org.apache.flink.streaming.api.graph.StreamConfig$NetworkInputConfig; local class incompatible: stream classdesc serialVersionUID = 3698633776553163849, local class serialVersionUID = 1038018964081769817
at java.base/java.io.ObjectStreamClass.initNonProxy(Unknown Source)
at java.base/java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.base/java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.base/java.io.ObjectInputStream.readObject0(Unknown Source)
at java.base/java.io.ObjectInputStream.readArray(Unknown Source)
at java.base/java.io.ObjectInputStream.readObject0(Unknown Source)
at java.base/java.io.ObjectInputStream.readObject(Unknown Source)
at java.base/java.io.ObjectInputStream.readObject(Unknown Source)
at org.apache.flink.util.InstantiationUtil.deserializeObject(InstantiationUtil.java:615)
at org.apache.flink.util.InstantiationUtil.deserializeObject(InstantiationUtil.java:600)
at org.apache.flink.util.InstantiationUtil.deserializeObject(InstantiationUtil.java:587)
at org.apache.flink.util.InstantiationUtil.readObjectFromConfig(InstantiationUtil.java:541)
at org.apache.flink.streaming.api.graph.StreamConfig.getInputs(StreamConfig.java:268)
... 28 more
</code>```

Body:
Flink Version: 1.13.5

JDK version: 11

Jackson version: 2.13.1

Avro Serializer version: 6.1.1

Kafka Clients version: 3.1.0

HighAvailability: Enabled

Deployed on Kubernetes. Deleted all previous checkpoints.

The application runs fine on Flink 1.12.4 with both JDK 8 and 11. However, once I upgrade to 1.13.5 on JDK 11, I encounter this error. Not sure how to fix it. Any help is appreciated. Thank you.

switched from INITIALIZING to FAILED with failure cause: org.apache.flink.streaming.runtime.tasks.StreamTaskException: Could not deserialize inputs
at org.apache.flink.streaming.api.graph.StreamConfig.getInputs(StreamConfig.java:274)
at org.apache.flink.streaming.api.graph.StreamConfig.getTypeSerializerIn(StreamConfig.java:289)
at org.apache.flink.streaming.api.graph.StreamConfig.getTypeSerializerIn1(StreamConfig.java:280)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.wrapOperatorIntoOutput(OperatorChain.java:691)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:637)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:619)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:619)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:619)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:619)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:619)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:619)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:619)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOperatorChain(OperatorChain.java:619)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.createOutputCollector(OperatorChain.java:569)
at org.apache.flink.streaming.runtime.tasks.OperatorChain.<init>(OperatorChain.java:186)
at org.apache.flink.streaming.runtime.tasks.StreamTask.executeRestore(StreamTask.java:551)
at org.apache.flink.streaming.runtime.tasks.StreamTask.runWithCleanUpOnFail(StreamTask.java:650)
at org.apache.flink.streaming.runtime.tasks.StreamTask.restore(StreamTask.java:540)
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:759)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:566)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.io.InvalidClassException: org.apache.flink.streaming.api.graph.StreamConfig$NetworkInputConfig; local class incompatible: stream classdesc serialVersionUID = 3698633776553163849, local class serialVersionUID = 1038018964081769817
at java.base/java.io.ObjectStreamClass.initNonProxy(Unknown Source)
at java.base/java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.base/java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.base/java.io.ObjectInputStream.readObject0(Unknown Source)
at java.base/java.io.ObjectInputStream.readArray(Unknown Source)
at java.base/java.io.ObjectInputStream.readObject0(Unknown Source)
at java.base/java.io.ObjectInputStream.readObject(Unknown Source)
at java.base/java.io.ObjectInputStream.readObject(Unknown Source)
at org.apache.flink.util.InstantiationUtil.deserializeObject(InstantiationUtil.java:615)
at org.apache.flink.util.InstantiationUtil.deserializeObject(InstantiationUtil.java:600)
at org.apache.flink.util.InstantiationUtil.deserializeObject(InstantiationUtil.java:587)
at org.apache.flink.util.InstantiationUtil.readObjectFromConfig(InstantiationUtil.java:541)
at org.apache.flink.streaming.api.graph.StreamConfig.getInputs(StreamConfig.java:268)
... 28 more


问:
Google ads authorize via javascript popup
We're trying to create an easy auth flow in our app to manage multiple user's Google ads campaign data. We would like to get the permissions via javascript popup on the client app and then use the token to make updates.

Would somebody have a code example of how to do this? Also a description of best practice flow.

The actual updates to the campaigns can happen client side or server side if there's limitations with the api on the client side, but the authorization should happen client side.


问:
Relation between fitness function, fitness score and weights in Deap
I'm using Deap to do a multi-objective optimization and I don't understand the relation between the output of the fitness functions, the weights and the fitness score.
Lest say i have two fitness functions that theoretically can give these outputs (maximize):

Fitness function 1 output: 0-1

Fitness function 2 output: 0-10

Let's also assume that is "exponentially difficult" to get a 1 for fitness function one and it is more of a linear from fitness function 2. What should the weights be in Deap?

```<code> 1. creator.create("FitnessMax", base.Fitness, weights=(10.0, 1.0))
 2. creator.create("FitnessMax", base.Fitness, weights=(1.0, 1.0))
 3. Something else?
</code>```

Body:
I'm using Deap to do a multi-objective optimization and I don't understand the relation between the output of the fitness functions, the weights and the fitness score.
Lest say i have two fitness functions that theoretically can give these outputs (maximize):

Fitness function 1 output: 0-1

Fitness function 2 output: 0-10

Let's also assume that is "exponentially difficult" to get a 1 for fitness function one and it is more of a linear from fitness function 2. What should the weights be in Deap?

 1. creator.create("FitnessMax", base.Fitness, weights=(10.0, 1.0))
 2. creator.create("FitnessMax", base.Fitness, weights=(1.0, 1.0))
 3. Something else?


问:
How to aggregate PAPI uncore events such as skx_unc_imc0 to measure for all devices?
PAPI counts events per device (which can be iMC, caching and home agent(cha)). These are counted as separate events such as skx_unc_imc0::UNC_M_RPQ_OCCUPANCY for iMC 0. Is there a way to measure this for all the iMCs at the same time?
The Linux perf tool can do this, an equivalent event is unc_m_rpq_occupancy, but this cannot be measured from PAPI.</p>


问:
Beginner - Naive Bayes Classification runs into Error - Record Problem?
for our project work in university we need to write a machine learning code. Unfortunately I don't have any programming knowledge and am a bit helpless.
My classification is Naive Bayes and when I run the code I get an error:
ValueError: Input contains NaN, infinity or a value too large for dtype('float64').

Unfortunately, I can't do anything with this and also nothing with the solutions found so far in the forum. Maybe someone can help me?

```<code>dat = pd.get_dummies(df)

# Define X and y
X = dat.drop('RESP', axis = 1)
y = dat['RESP']

# training and testing data
from sklearn.model_selection import train_test_split

# assign test data size 30%
X_train, X_test, y_train, y_test =train_test_split(X,y,test_size= 0.3, random_state=0)

#BERNOULLI
# importing classifier
from sklearn.naive_bayes import BernoulliNB

# initializaing the NB
classifer = BernoulliNB()

# training the model
classifer.fit(X_train, y_train)

# testing the model
y_pred = classifer.predict(X_test)
</code>```

Error:

```<code>

---------------------------------------------------------------------------

ValueError                                Traceback (most recent call last)

<ipython-input-22-df3c037d90d0> in <module>
     23
     24 # testing the model
---> 25 y_pred = classifer.predict(X_test)

5 frames

/usr/local/lib/python3.8/dist-packages/sklearn/naive_bayes.py in predict(self, X)
     80         """
     81         check_is_fitted(self)
---> 82         X = self._check_X(X)
     83         jll = self._joint_log_likelihood(X)
     84         return self.classes_[np.argmax(jll, axis=1)]

/usr/local/lib/python3.8/dist-packages/sklearn/naive_bayes.py in _check_X(self, X)
   1145     def _check_X(self, X):
   1146         """Validate X, used only in predict* methods."""
-> 1147         X = super()._check_X(X)
   1148         if self.binarize is not None:
   1149             X = binarize(X, threshold=self.binarize)

/usr/local/lib/python3.8/dist-packages/sklearn/naive_bayes.py in _check_X(self, X)
    517     def _check_X(self, X):
    518         """Validate X, used only in predict* methods."""
--> 519         return self._validate_data(X, accept_sparse="csr", reset=False)
    520
    521     def _check_X_y(self, X, y, reset=True):

/usr/local/lib/python3.8/dist-packages/sklearn/base.py in _validate_data(self, X, y, reset, validate_separately, **check_params)
    564             raise ValueError("Validation should be done on X, y or both.")
    565         elif not no_val_X and no_val_y:
--> 566             X = check_array(X, **check_params)
    567             out = X
    568         elif no_val_X and not no_val_y:

/usr/local/lib/python3.8/dist-packages/sklearn/utils/validation.py in check_array(array, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, estimator)
    798
    799         if force_all_finite:
--> 800             _assert_all_finite(array, allow_nan=force_all_finite == "allow-nan")
    801
    802     if ensure_min_samples > 0:

/usr/local/lib/python3.8/dist-packages/sklearn/utils/validation.py in _assert_all_finite(X, allow_nan, msg_dtype)
    112         ):
    113             type_err = "infinity" if allow_nan else "NaN, infinity"
--> 114             raise ValueError(
    115                 msg_err.format(
    116                     type_err, msg_dtype if msg_dtype is not None else X.dtype

ValueError: Input contains NaN, infinity or a value too large for dtype('float64').
</code>```

Body:
for our project work in university we need to write a machine learning code. Unfortunately I don't have any programming knowledge and am a bit helpless.
My classification is Naive Bayes and when I run the code I get an error:
ValueError: Input contains NaN, infinity or a value too large for dtype('float64').

Unfortunately, I can't do anything with this and also nothing with the solutions found so far in the forum. Maybe someone can help me?

dat = pd.get_dummies(df)

# Define X and y
X = dat.drop('RESP', axis = 1)
y = dat['RESP']

# training and testing data
from sklearn.model_selection import train_test_split

# assign test data size 30%
X_train, X_test, y_train, y_test =train_test_split(X,y,test_size= 0.3, random_state=0)

#BERNOULLI
# importing classifier
from sklearn.naive_bayes import BernoulliNB

# initializaing the NB
classifer = BernoulliNB()

# training the model
classifer.fit(X_train, y_train)

# testing the model
y_pred = classifer.predict(X_test)

Error:

---------------------------------------------------------------------------

ValueError                                Traceback (most recent call last)

<ipython-input-22-df3c037d90d0> in <module>
     23
     24 # testing the model
---> 25 y_pred = classifer.predict(X_test)

5 frames

/usr/local/lib/python3.8/dist-packages/sklearn/naive_bayes.py in predict(self, X)
     80         """
     81         check_is_fitted(self)
---> 82         X = self._check_X(X)
     83         jll = self._joint_log_likelihood(X)
     84         return self.classes_[np.argmax(jll, axis=1)]

/usr/local/lib/python3.8/dist-packages/sklearn/naive_bayes.py in _check_X(self, X)
   1145     def _check_X(self, X):
   1146         """Validate X, used only in predict* methods."""
-> 1147         X = super()._check_X(X)
   1148         if self.binarize is not None:
   1149             X = binarize(X, threshold=self.binarize)

/usr/local/lib/python3.8/dist-packages/sklearn/naive_bayes.py in _check_X(self, X)
    517     def _check_X(self, X):
    518         """Validate X, used only in predict* methods."""
--> 519         return self._validate_data(X, accept_sparse="csr", reset=False)
    520
    521     def _check_X_y(self, X, y, reset=True):

/usr/local/lib/python3.8/dist-packages/sklearn/base.py in _validate_data(self, X, y, reset, validate_separately, **check_params)
    564             raise ValueError("Validation should be done on X, y or both.")
    565         elif not no_val_X and no_val_y:
--> 566             X = check_array(X, **check_params)
    567             out = X
    568         elif no_val_X and not no_val_y:

/usr/local/lib/python3.8/dist-packages/sklearn/utils/validation.py in check_array(array, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, estimator)
    798
    799         if force_all_finite:
--> 800             _assert_all_finite(array, allow_nan=force_all_finite == "allow-nan")
    801
    802     if ensure_min_samples > 0:

/usr/local/lib/python3.8/dist-packages/sklearn/utils/validation.py in _assert_all_finite(X, allow_nan, msg_dtype)
    112         ):
    113             type_err = "infinity" if allow_nan else "NaN, infinity"
--> 114             raise ValueError(
    115                 msg_err.format(
    116                     type_err, msg_dtype if msg_dtype is not None else X.dtype

ValueError: Input contains NaN, infinity or a value too large for dtype('float64').


问:
Could not cast value of type '__NSCFNumber' to 'NSString'
I have this code let Model = i.get("Model") as! String I am using it from my firestore database. I am trying to make it search that. I tried it with other fields and it worked just not with some that were integers and Model when model in my database is a String. I get this error  Could not cast value of type '__NSCFNumber' (0x7f851d873250) to 'NSString' (0x7fff86cf7118).


问:
Flexible and customized tables using svg
When representing conditionnal probabilities (P(X|Y,Z,...), one has to deal with large tables of numbers (aka CPTs). PyAgrum (a python package) use html in notebooks to obtain a quite good representation of these CPTs :

The size, the number of columns in the headers, bgcolors of cells, etc. have to be very flexible. HTML table are very usefool tool to do this job. However HTML representation is not easy to export and to use outside a notebook.

So I am looking for ideas to do the same job but either in SVG or PDF or other.


问:
Creating a sources jar that also include the source code of project dependencies
I have a multi-project gradle build, using kotlin as build script language.

I can build a "fat" jar containing all project dependencies (.class files)
I am not sure how it works. But it goes through all dependencies and exclude duplicate packages.

```<code>tasks.jar {
    //manifest.attributes["Main-Class"] = "com.example.MyMainClass"
    val dependencies = configurations
        .runtimeClasspath
        .get()
        .map(::zipTree) // OR .map { zipTree(it) }
    from(dependencies)
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
</code>```

Is there some equivalent way to create a sources jar. Including the source code
of all dependencies?

Side question: Can you declare sources like dependencies?

```<code>dependencies {
    implementation(project(":common"))
    implementation(files("../libs/somejar1.jar"))
    implementation(files("../libs/somejar2.jar"))
}

sources {
    ?
}

</code>```

Edit

I have written a library. The library has code I have written (multiple modules). The modules have dependencies. (Could be other modules within the project, and/or other libraries) I have the other libraries' as jar files stored locally together with the source code of those libraries.

I am able to pack all the code I have written together with my codes dependencies into a single fat jar.

It would be nice to also be able to pack all source files (including the source files of the dependencies) into a "fat sources jar".

That way, when I want to use my library in other projects. I can have 2 jars. One with all the .class files and one sources jar with all the .java files.

Body:
I have a multi-project gradle build, using kotlin as build script language.

I can build a "fat" jar containing all project dependencies (.class files)
I am not sure how it works. But it goes through all dependencies and exclude duplicate packages.

tasks.jar {
    //manifest.attributes["Main-Class"] = "com.example.MyMainClass"
    val dependencies = configurations
        .runtimeClasspath
        .get()
        .map(::zipTree) // OR .map { zipTree(it) }
    from(dependencies)
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

Is there some equivalent way to create a sources jar. Including the source code
of all dependencies?

Side question: Can you declare sources like dependencies?

dependencies {
    implementation(project(":common"))
    implementation(files("../libs/somejar1.jar"))
    implementation(files("../libs/somejar2.jar"))
}

sources {
    ?
}

Edit

I have written a library. The library has code I have written (multiple modules). The modules have dependencies. (Could be other modules within the project, and/or other libraries) I have the other libraries' as jar files stored locally together with the source code of those libraries.

I am able to pack all the code I have written together with my codes dependencies into a single fat jar.

It would be nice to also be able to pack all source files (including the source files of the dependencies) into a "fat sources jar".

That way, when I want to use my library in other projects. I can have 2 jars. One with all the .class files and one sources jar with all the .java files.


问:
How to use google drive video embedded via iframe without video controls?
I want to remove control from video. Any Solution to remove video controls?

I'm trying to use a google drive video using embed iframe and it works good, but I have tried to remove control using Controls="false" in iframe, but it does not works. Any other way to remove video controls from iframe video?


问:
How do I use animation that spreads up and down when I make a drop-down menu?
I'm making a drop-down menu now. When I put my mouse on a specific part, the drop-down menu opens and when the mouse goes out of the browser, I want to make the drop-down menu disappear. I made a state value called isMouseOver to return true when the mouse goes up and to use jquery to return false when the mouse goes out of the browser. When the mouse goes up, I used animation to implement it as I wanted, but I want to implement animation that slowly disappears up when the mouse goes out of the browser, but this part doesn't work well. I put this part in an animation as well, but the animation overlapped and it was executed strangely. To sum up the question, how do I put the animation when isMouseOver becomes false and the display becomes none?

```<code>import { useState } from 'react';
import styled, {keyframes} from 'styled-components';
import $ from 'jquery';

// animation when mouseover
const dropdownAnimation = keyframes`
  0% {
    transform: translateY(-30%);
  }

  100% {
    transform: translateY(0);
  }
`

function HeaderRight () {

  // Check mouseover
  const [isMouseOver, setIsMouseOver] = useState(false)

  // return true when mouse over
  const ActMouseOver = () => {
    setIsMouseOver(true)
  }

  // return false when mouse over
  const ActMouseLeave = () => {
    setIsMouseOver(false)
  }

  // return false when the mouse is out of the browser
  $(document).mouseleave(function () {
    ActMouseLeave();
  });

  return (
    <HeaderRightWrap isMouseOver={isMouseOver} onMouseEnter={ActMouseOver}>
      <ul className='HeaderRightWrapUl'>
        <li className='HeaderRightWrapUlLi'>
          <ul className='HeaderRightWrapUlLiUl'>
            <li className='HeaderRightWrapUlLiUlLi'>
              Hello
            </li>
          </ul>
        </li>
      </ul>
    </HeaderRightWrap>
  )
}

export default HeaderRight;

const HeaderRightWrap = styled.div`
  position: relative;
  box-sizing: border-box;
  bottom: 40px;

  .HeaderRightWrapUl {
    height: 100%;
    margin: 0 auto;
    padding: 0;
    list-style: none;
    box-sizing: border-box;
    display: block;
    margin-inline-end: 0px;
    margin-inline-start: 0px;
    margin-block-start: 1em;
    margin-block-end: 1em;
    padding-inline-start: 40px;
  }

  .HeaderRightWrapUlLi {
    z-index: 1000;
    position: relative;
    float: left;
    width: auto;
    height: 100%;
    padding-right: 80px;
    transition: padding .3s;
  }

  .HeaderRightWrapUlLiUl {
    display: ${props=>props.isMouseOver===true?'auto':'none'};
    position: absolute;
    animation: ${dropdownAnimation} 0.3s ease;
  }

  .HeaderRightWrapUlLiUlLi {
    margin-top: 0;
  }
`
</code>```

Body:
I'm making a drop-down menu now. When I put my mouse on a specific part, the drop-down menu opens and when the mouse goes out of the browser, I want to make the drop-down menu disappear. I made a state value called isMouseOver to return true when the mouse goes up and to use jquery to return false when the mouse goes out of the browser. When the mouse goes up, I used animation to implement it as I wanted, but I want to implement animation that slowly disappears up when the mouse goes out of the browser, but this part doesn't work well. I put this part in an animation as well, but the animation overlapped and it was executed strangely. To sum up the question, how do I put the animation when isMouseOver becomes false and the display becomes none?

import { useState } from 'react';
import styled, {keyframes} from 'styled-components';
import $ from 'jquery';

// animation when mouseover
const dropdownAnimation = keyframes`
  0% {
    transform: translateY(-30%);
  }

  100% {
    transform: translateY(0);
  }
`

function HeaderRight () {

  // Check mouseover
  const [isMouseOver, setIsMouseOver] = useState(false)

  // return true when mouse over
  const ActMouseOver = () => {
    setIsMouseOver(true)
  }

  // return false when mouse over
  const ActMouseLeave = () => {
    setIsMouseOver(false)
  }

  // return false when the mouse is out of the browser
  $(document).mouseleave(function () {
    ActMouseLeave();
  });

  return (
    <HeaderRightWrap isMouseOver={isMouseOver} onMouseEnter={ActMouseOver}>

              Hello

    </HeaderRightWrap>
  )
}

export default HeaderRight;

const HeaderRightWrap = styled.div`
  position: relative;
  box-sizing: border-box;
  bottom: 40px;

  .HeaderRightWrapUl {
    height: 100%;
    margin: 0 auto;
    padding: 0;
    list-style: none;
    box-sizing: border-box;
    display: block;
    margin-inline-end: 0px;
    margin-inline-start: 0px;
    margin-block-start: 1em;
    margin-block-end: 1em;
    padding-inline-start: 40px;
  }

  .HeaderRightWrapUlLi {
    z-index: 1000;
    position: relative;
    float: left;
    width: auto;
    height: 100%;
    padding-right: 80px;
    transition: padding .3s;
  }

  .HeaderRightWrapUlLiUl {
    display: ${props=>props.isMouseOver===true?'auto':'none'};
    position: absolute;
    animation: ${dropdownAnimation} 0.3s ease;
  }

  .HeaderRightWrapUlLiUlLi {
    margin-top: 0;
  }
`


问:
passing value from custom preprocess theme hook function to a template in drupal 9
Situation: I want to write a proprocess PHP function [theme]_preprocess_example__p1 that adds variables to a page template file example--p1.html.twig but the variable cannot display properly if I inlcude the template to page--front.html.twig.

page--front.html.twig

I added the following code in page--front.html.twig

```<code>{% include '@[theme]/directory/example--p1.html.twig' %}
</code>```

example--p1.html.twig

this file has one variable {{ text }}. to display the text message.

[theme].theme

I added the following code in [theme].theme

```<code>[theme]_preprocess_example__p1(array &$variables, $hook){
 $variables['name'] = 'message';
 $variables['text'] = 'example p1 message';
 $variables['data'] = 'm1';
}
</code>```

but I cannot display text variable to the template example--p1.html.twig when I added include {% include '@[theme]/directory/example--p1.html.twig' %} in page--front.html.twig.

Someone suggest creating all the variables to ExampleController.php and use example.module to define hook_theme() function and function [theme]_preprocess_example__p1() but it is failed to display the variables when I include the template example--p1.html.twig for duplicated code to page--front.html.twig template. How can I solve it?

Body:
Situation: I want to write a proprocess PHP function [theme]_preprocess_example__p1 that adds variables to a page template file example--p1.html.twig but the variable cannot display properly if I inlcude the template to page--front.html.twig.

page--front.html.twig

I added the following code in page--front.html.twig

{% include '@[theme]/directory/example--p1.html.twig' %}

example--p1.html.twig

this file has one variable {{ text }}. to display the text message.

[theme].theme

I added the following code in [theme].theme

[theme]_preprocess_example__p1(array &$variables, $hook){
 $variables['name'] = 'message';
 $variables['text'] = 'example p1 message';
 $variables['data'] = 'm1';
}

but I cannot display text variable to the template example--p1.html.twig when I added include {% include '@[theme]/directory/example--p1.html.twig' %} in page--front.html.twig.

Someone suggest creating all the variables to ExampleController.php and use example.module to define hook_theme() function and function [theme]_preprocess_example__p1() but it is failed to display the variables when I include the template example--p1.html.twig for duplicated code to page--front.html.twig template. How can I solve it?


问:
Subscribe to user changes with Okta/Azure AD/Auth0
We are currently implementing feature on our server to allow our B2B customers to connect their own SSO method. So we will automatically register a user if he doesn't have any account.

But we will have to watch if the given user is deleted from the customer group. Is there any way to set a web hook on our side, to receive events from that customer's SSO, in order to be aware of a user deletion (or any other kind of edit that requires the user's token revocation) ?

Otherwise, I know we'll have to periodically send the given refresh token to the provider, so that we know that we can still trust the user existence from the customer's list. But if there's any other way to check that, we will look into it


问:
Searchalgorithm in Modelica/Dymola
I'm currently trying to create a Modelica-Code, that searchs through an Array full of strings, compares them to strings in a different Array and safes the location where it found it and the location of the initial Matrix.

My Code as an example can be seen here:

```<code>parameter String Matrix[3,3]={{"Pumpe1","Widerstand1","Ventil1"},{"Zweig","Widerstand2","Ventil2"},{"Druckrand","Widerstand3","Ventil3"}};

 parameter String Ueberschrift[1,5]={{"Ventil1","Pumpe1","Druckrand","Ventil3","Ventil2"}};
 Integer Stringvergleich;
 Integer Ortsvektor[9,3];
 Integer Laufvariable;
algorithm
  Laufvariable:=0;

  for i in 1:3 loop
    for l in 1:3 loop
      Laufvariable:=Laufvariable + 1;
      for m in 1:5 loop
        Stringvergleich:=Modelica.Utilities.Strings.find(Ueberschrift[1,m],Matrix[i,l]);
        if not Stringvergleich==0 then
          Ortsvektor[1,Laufvariable]:=i;
          Ortsvektor[2,Laufvariable]:=l;
          Ortsvektor[3,Laufvariable]:=m;
        end if;
      end for;
    end for;
  end for;
</code>```

Unfortunately this code seems to be wrong, but I can't figure out what the Problem is. Dymola sends the following Error message:
Index out of bounds
Failed condition: (j>=1)&&(j<=dim)
Error: Integrator failed to start model.

Title: Searchalgorithm in Modelica/Dymola

Body:
I'm currently trying to create a Modelica-Code, that searchs through an Array full of strings, compares them to strings in a different Array and safes the location where it found it and the location of the initial Matrix.

My Code as an example can be seen here:

parameter String Matrix[3,3]={{"Pumpe1","Widerstand1","Ventil1"},{"Zweig","Widerstand2","Ventil2"},{"Druckrand","Widerstand3","Ventil3"}};

 parameter String Ueberschrift[1,5]={{"Ventil1","Pumpe1","Druckrand","Ventil3","Ventil2"}};
 Integer Stringvergleich;
 Integer Ortsvektor[9,3];
 Integer Laufvariable;
algorithm
  Laufvariable:=0;

  for i in 1:3 loop
    for l in 1:3 loop
      Laufvariable:=Laufvariable + 1;
      for m in 1:5 loop
        Stringvergleich:=Modelica.Utilities.Strings.find(Ueberschrift[1,m],Matrix[i,l]);
        if not Stringvergleich==0 then
          Ortsvektor[1,Laufvariable]:=i;
          Ortsvektor[2,Laufvariable]:=l;
          Ortsvektor[3,Laufvariable]:=m;
        end if;
      end for;
    end for;
  end for;

Unfortunately this code seems to be wrong, but I can't figure out what the Problem is. Dymola sends the following Error message:
Index out of bounds
Failed condition: (j>=1)&&(j<=dim)
Error: Integrator failed to start model.


问:
How to use where as function and select function in POV of SQL Injection
As I have to fetch data multiple times so I created select function and where function is it write way to way to use and also in point of view of SQL Injection , this way is not good ? Please guide</p>
```<code>function where($column, $value) {
  return "AND $column = :$column";
}

function fetchCategory($where, $data1) {
  // Create a PDO instance
  $db = Database::newInstance();

  // Build the SELECT statement with a WHERE clause
  $sql1 = "SELECT * FROM category WHERE 1=1 $where";

  // Execute the SELECT statement with bound parameters
  $row1 = $db->read($sql1, $data1);

  // Return the result set
  return $row1;
}
</code>```
```<code>$where = where('cat_id', $value->parent_id);
$data1 = array(':cat_id' => $value->parent_id);
$result = fetchCategory($where, $data1);

if ($result) {
  // Fetch the data from the result set
  $data['Dis_05']= $result[0]->category;
} else {
  // No data was found
  echo "No data found";
}
</code>```

Body:
As I have to fetch data multiple times so I created select function and where function is it write way to way to use and also in point of view of SQL Injection , this way is not good ? Please guide

function where($column, $value) {
  return "AND $column = :$column";
}

function fetchCategory($where, $data1) {
  // Create a PDO instance
  $db = Database::newInstance();

  // Build the SELECT statement with a WHERE clause
  $sql1 = "SELECT * FROM category WHERE 1=1 $where";

  // Execute the SELECT statement with bound parameters
  $row1 = $db->read($sql1, $data1);

  // Return the result set
  return $row1;
}

$where = where('cat_id', $value->parent_id);
$data1 = array(':cat_id' => $value->parent_id);
$result = fetchCategory($where, $data1);

if ($result) {
  // Fetch the data from the result set
  $data['Dis_05']= $result[0]->category;
} else {
  // No data was found
  echo "No data found";
}


问:
gensim LdaMulticore can't work on cloud function
I want to use gensim LDA module on cloud function, but it time out and show "/layers/google.python.pip/pip/lib/python3.8/site-packages/past/builtins/misc.py:45: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses".

But the same code worked on colab (python 3.8.16) and I did't find any bug in it.
It can print 'LDA1' and 'LDA2', then time out.

```<code>def LDA(corpus, dictionary, NumTopic):
    print('LDA1')
    time1 = time.time()
    print('LDA2')
    lda = gensim.models.LdaMulticore(corpus=corpus, id2word=dictionary, num_topics=NumTopic,  chunksize=1000, iterations=200, passes=20, per_word_topics=False,  random_state=100)
    print('LDA3')
    corpus_lda = lda[corpus]
    print("LDA takes %2.2f seconds." % (time.time() - time1))
    return lda, corpus_lda
</code>```

1.I have tried diffierent python version like 3.10, 3.8, 3.7

2.ADD import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)

3.It works on colab and 300 text just cost 10 sec, but I need it work on cloud function QQ

Body:
I want to use gensim LDA module on cloud function, but it time out and show "/layers/google.python.pip/pip/lib/python3.8/site-packages/past/builtins/misc.py:45: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses".

But the same code worked on colab (python 3.8.16) and I did't find any bug in it.
It can print 'LDA1' and 'LDA2', then time out.

def LDA(corpus, dictionary, NumTopic):
    print('LDA1')
    time1 = time.time()
    print('LDA2')
    lda = gensim.models.LdaMulticore(corpus=corpus, id2word=dictionary, num_topics=NumTopic,  chunksize=1000, iterations=200, passes=20, per_word_topics=False,  random_state=100)
    print('LDA3')
    corpus_lda = lda[corpus]
    print("LDA takes %2.2f seconds." % (time.time() - time1))
    return lda, corpus_lda

1.I have tried diffierent python version like 3.10, 3.8, 3.7

2.ADD import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)

3.It works on colab and 300 text just cost 10 sec, but I need it work on cloud function QQ


问:
Value-Function VBA
```<code>Function evaluation_frequency(device As Range, tester As Range, tester_config As Range, Optional tester_name As Range) As String
  If InStr("FREQUENCY", tester_name.Value) <> 0 Then
    Exit Function
  Else
    If tester = "Y" Then
      If WorksheetFunction.IsNumber(WorksheetFunction.Search(tester_config, device)) = True Then
        Set evaluation_frequency = "run"
        Exit Function
      Else Call evaluation_frequency(device, tester.Offset(i + 1, 0), tester_name.Offset(i + 1, 0))
      End If
    Else
      Call evaluation_frequency(device, tester.Offset(i + 1, 0), tester_name.Offset(i + 1, 0))
    End If
  End If
End Function
</code>```

When I insert this function inside a range in excel, the code doesn't work and popped an Object required error specifically at this line Set evaluation_frequency = "run". Then I changed to the function type from String to Range and also Set evaluation_frequency.Value = "run", which will give the result I want.

Here is the snippet of how it looked on the Worksheet.

What I want: instead of changing the value of the range to a fix one word, which in my function is "run", the function will add the word "run" on the existing value of that range. Or in other words, it can be used with other function and the range or cell can both store the output of the function evaluation_frequency and other function.

Title: Value-Function VBA

Body:
Function evaluation_frequency(device As Range, tester As Range, tester_config As Range, Optional tester_name As Range) As String
  If InStr("FREQUENCY", tester_name.Value) <> 0 Then
    Exit Function
  Else
    If tester = "Y" Then
      If WorksheetFunction.IsNumber(WorksheetFunction.Search(tester_config, device)) = True Then
        Set evaluation_frequency = "run"
        Exit Function
      Else Call evaluation_frequency(device, tester.Offset(i + 1, 0), tester_name.Offset(i + 1, 0))
      End If
    Else
      Call evaluation_frequency(device, tester.Offset(i + 1, 0), tester_name.Offset(i + 1, 0))
    End If
  End If
End Function

When I insert this function inside a range in excel, the code doesn't work and popped an Object required error specifically at this line Set evaluation_frequency = "run". Then I changed to the function type from String to Range and also Set evaluation_frequency.Value = "run", which will give the result I want.

Here is the snippet of how it looked on the Worksheet.

What I want: instead of changing the value of the range to a fix one word, which in my function is "run", the function will add the word "run" on the existing value of that range. Or in other words, it can be used with other function and the range or cell can both store the output of the function evaluation_frequency and other function.


问:
How to map custom report ts file from node library in playwright.config.ts?
I came across custom report feature in Playwright(node js). I would like to use the custom-reporter.ts class from the external node library installed.
Please help me to know, How to map that file in Playwright.config.ts?</p>
```<code>   (playwright.config.ts)
        config = {
           reporter: './node_modules/mylibrary/report/lib/my-reporter'
        }
    It works, but i am not sure whether this approach is adviceable or not.
</code>```

Body:
I came across custom report feature in Playwright(node js). I would like to use the custom-reporter.ts class from the external node library installed.
Please help me to know, How to map that file in Playwright.config.ts?

   (playwright.config.ts)
        config = {
           reporter: './node_modules/mylibrary/report/lib/my-reporter'
        }
    It works, but i am not sure whether this approach is adviceable or not.


问:
Amplify Flutter returns null when creating a manyToMany item
I am making a chat application which has two tables like below:

```<code>type User @model @auth(rules: [{ allow: public, operations: [create, read], provider: iam }]) {
    id: ID!

    # relation
    rooms: [Room] @manyToMany(relationName: "UserRoom")
}

type Room @model @auth(rules: [{ allow: public, operations: [create, read], provider: iam }]) {
    id: ID!

    # relation
    users: [User] @manyToMany(relationName: "UserRoom")
}
</code>```

and I wrote a code to 'enter a chat room' like below:

Future<UserRoom?> join(Room room, User user) async {
  try {
    UserRoom userroom = UserRoom(room: room, user: user);
    final request = ModelMutations.create(userroom);
    final response = await Amplify.API.mutate(request: request).response;
    return response.data;
  } catch (error) {
    safePrint("Failed on Creating UserRoom: $error");
  }

  return null;
}
```

however the above function returns null and creates nothing in my DynamoDB.

I've tried Amplify DataStore, but it does not work as I expected.
(e.g. I need to create an item simultaneously regardless of network condition but it take longer than I expected.)

I am expecting the joined row is successfully created.

Body:
I am making a chat application which has two tables like below:

type User @model @auth(rules: [{ allow: public, operations: [create, read], provider: iam }]) {
    id: ID!

    # relation
    rooms: [Room] @manyToMany(relationName: "UserRoom")
}

type Room @model @auth(rules: [{ allow: public, operations: [create, read], provider: iam }]) {
    id: ID!

    # relation
    users: [User] @manyToMany(relationName: "UserRoom")
}

and I wrote a code to 'enter a chat room' like below:

Future<UserRoom?> join(Room room, User user) async {
  try {
    UserRoom userroom = UserRoom(room: room, user: user);
    final request = ModelMutations.create(userroom);
    final response = await Amplify.API.mutate(request: request).response;
    return response.data;
  } catch (error) {
    safePrint("Failed on Creating UserRoom: $error");
  }

  return null;
}

however the above function returns null and creates nothing in my DynamoDB.

I've tried Amplify DataStore, but it does not work as I expected.
(e.g. I need to create an item simultaneously regardless of network condition but it take longer than I expected.)

I am expecting the joined row is successfully created.


问:
Convert std::string into varchar/varchar array for sql statement
I am executing a proc C(.pc) file in my project, with below steps:

Step-1:
I have a string with ',' separated delimiter:

```<code>    string string1={"Delhi","Bombay","Pune");
</code>```

Step-2:
I am creating a varchar

```<code>    varchar str[100]
</code>```

Step-3:
copy string1 to str using strcpy/strncpy

Step-4
Executing the query

```<code>    select column1, column2 from table where column1 in (str.arr);
</code>```

The query is returning 0 values, but if I hard code as below:

```<code>    select column1, column2 from table where column1 in ('Delhi','Bombay','Pune');
</code>```

I am getting 5 rows as output

I am missing how to effictively convert the string to varchar/multiset, which can be used in the select statemnt.

Are there any steps for converting the string into varchar or multiset.

Body:
I am executing a proc C(.pc) file in my project, with below steps:

Step-1:
I have a string with ',' separated delimiter:

    string string1={"Delhi","Bombay","Pune");

Step-2:
I am creating a varchar

    varchar str[100]

Step-3:
copy string1 to str using strcpy/strncpy

Step-4
Executing the query

    select column1, column2 from table where column1 in (str.arr);

The query is returning 0 values, but if I hard code as below:

    select column1, column2 from table where column1 in ('Delhi','Bombay','Pune');

I am getting 5 rows as output

I am missing how to effictively convert the string to varchar/multiset, which can be used in the select statemnt.

Are there any steps for converting the string into varchar or multiset.


问:
Why does emotion set box-sizing: border-box?
I found this answer stating that browsers that follow standards all default to the "content-box" box model.

I'm currently using Mantine, it uses Emotion to style its components. While styling something I noticed that my page isn't actually using the "content-box" box model. Then I found this element:

```

Which implies that emotion sets a global "border-box" box model.

What would motivate that decision?

Body:
I found this answer stating that browsers that follow standards all default to the "content-box" box model.

I'm currently using Mantine, it uses Emotion to style its components. While styling something I noticed that my page isn't actually using the "content-box" box model. Then I found this element:

Which implies that emotion sets a global "border-box" box model.

What would motivate that decision?


问:
How to store data in a variable which itself is in the list of varibales?
Here is the code:

```<code>df5 = pd.DataFrame()
df6 = pd.DataFrame()
df7 = pd.DataFrame()
df8 = pd.DataFrame()
df9 = pd.DataFrame()
chunk_size = 4
dfList = [df5, df6, df7, df8]
for i in range(4):
    dfList[i] = pd.DataFrame(np.array_split(dframe,chunk_size)[i])
</code>```

Now, I want to access the data stored in dfList[0] df5, but when printing df5, I get an empty dataframe. When I print dfList[0] it gives the correct output. Why is it so and can I get the output directly by printing df5?

Body:
Here is the code:

df5 = pd.DataFrame()
df6 = pd.DataFrame()
df7 = pd.DataFrame()
df8 = pd.DataFrame()
df9 = pd.DataFrame()
chunk_size = 4
dfList = [df5, df6, df7, df8]
for i in range(4):
    dfList[i] = pd.DataFrame(np.array_split(dframe,chunk_size)[i])

Now, I want to access the data stored in dfList[0] df5, but when printing df5, I get an empty dataframe. When I print dfList[0] it gives the correct output. Why is it so and can I get the output directly by printing df5?


问:
Typescript hints think that a value from a variable is never read in Vue template (eg v-for), except it is. TS6133
The editor doesn't know the type of brIndex neither. If I remove brIndex from the :key property, then both eslint's vue/no-unused-vars (expected) and the TS6133 show up.

Here's my tsconfig.json:

{
  "extends": "@vue/tsconfig/tsconfig.web.json",
  "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
  "compilerOptions": {
    "allowJs": true,
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    }
  },

  "references": [
    {
      "path": "./tsconfig.config.json"
    }
  ]
}
```
<p><code>tsconfig.config.json</code>:</p>
<pre class="lang-json prettyprint-override"><code>{
  "extends": "@vue/tsconfig/tsconfig.node.json",
  "include": [
    "vite.config.*",
    "vitest.config.*",
    "cypress.config.*",
    "playwright.config.*"
  ],
  "compilerOptions": {
    "composite": true,
    "types": ["node"],
    "allowJs": true
  }
}
</code>```

package.json:

{
  "type": "module",
  "scripts": {
    // scripts...
  },
  "dependencies": {
    "vue": "^3.2.45",
    "vue-router": "^4.1.6",
  },
  "devDependencies": {
    "@rushstack/eslint-patch": "^1.1.4",
    "@types/node": "^18.11.17",
    "@vitejs/plugin-vue": "^4.0.0",
    "@vue/eslint-config-typescript": "^11.0.0",
    "@vue/tsconfig": "^0.1.3",
    "eslint": "^8.30.0",
    "eslint-plugin-vue": "^9.8.0",
    "npm-run-all": "^4.1.5",
    "typescript": "~4.7.4",
    "vite": "^4.0.0",
    "vue-tsc": "^1.0.12"
  }
}
```
<p>I can provide any additional info.</p>
<p>I am using Volar takeover mode and have <code>"typescript.tsdk": "node_modules/typescript/lib"</code> in workspace's vscode <code>settings.json</code>. My ESLint is configured properly (doesn't differ from a new project's .eslintrc.cjs) and there are no warning from my editor in that regard.</p>
<p>I also have my <code>src/vue-shim.d.ts</code> file although I don't know why it's needed in this configuration, but there are errors without it:</p>
<pre class="lang-js prettyprint-override"><code>declare module '*.vue' {
  import type { DefineComponent } from 'vue'
  const component: DefineComponent<{}, {}, any>
  export default component
}
</code>```

And the /env.d.ts file:

/// <reference types="vite/client" />
```

vite.config.ts has the default resolve and alias settings that's all.

The bottom bar looks normal:

The project itself runs normally and without errors.

Body:
The editor doesn't know the type of brIndex neither. If I remove brIndex from the :key property, then both eslint's vue/no-unused-vars (expected) and the TS6133 show up.

Here's my tsconfig.json:

{
  "extends": "@vue/tsconfig/tsconfig.web.json",
  "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
  "compilerOptions": {
    "allowJs": true,
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    }
  },

  "references": [
    {
      "path": "./tsconfig.config.json"
    }
  ]
}

tsconfig.config.json:

{
  "extends": "@vue/tsconfig/tsconfig.node.json",
  "include": [
    "vite.config.*",
    "vitest.config.*",
    "cypress.config.*",
    "playwright.config.*"
  ],
  "compilerOptions": {
    "composite": true,
    "types": ["node"],
    "allowJs": true
  }
}

package.json:

{
  "type": "module",
  "scripts": {
    // scripts...
  },
  "dependencies": {
    "vue": "^3.2.45",
    "vue-router": "^4.1.6",
  },
  "devDependencies": {
    "@rushstack/eslint-patch": "^1.1.4",
    "@types/node": "^18.11.17",
    "@vitejs/plugin-vue": "^4.0.0",
    "@vue/eslint-config-typescript": "^11.0.0",
    "@vue/tsconfig": "^0.1.3",
    "eslint": "^8.30.0",
    "eslint-plugin-vue": "^9.8.0",
    "npm-run-all": "^4.1.5",
    "typescript": "~4.7.4",
    "vite": "^4.0.0",
    "vue-tsc": "^1.0.12"
  }
}

I can provide any additional info.

I am using Volar takeover mode and have "typescript.tsdk": "node_modules/typescript/lib" in workspace's vscode settings.json. My ESLint is configured properly (doesn't differ from a new project's .eslintrc.cjs) and there are no warning from my editor in that regard.

I also have my src/vue-shim.d.ts file although I don't know why it's needed in this configuration, but there are errors without it:

declare module '*.vue' {
  import type { DefineComponent } from 'vue'
  const component: DefineComponent<{}, {}, any>
  export default component
}

And the /env.d.ts file:

/// <reference types="vite/client" />

vite.config.ts has the default resolve and alias settings that's all.

The bottom bar looks normal:

The project itself runs normally and without errors.


问:
How to run loop in R
I have got multiple files in txt.gz format in a folder and wanted to run below command in R on all these files.I also wanted to add z_score in name while writing these files as shown below.

Could you please help me how to run below command for all files in R. I NEVER RUN ANY loop in R.

```<code>> Data = read.table(gzfile("sample1.txt.gz"),sep="", header = TRUE)

> colnames(Data)

> data_new <- Data
> data_new$z_score <- data_new$Effect/data_new$StdErr
> colnames(data_new)

> write.table(data_new,gzfile("sample1.z_score.txt.gz"))

###for loop

data_files <- list.files(“/Users/Joach/Desktop/MyFolder", pattern =*.txt.gz)
#Identify file names
data_files

for(FILES in data_files) {
Data <- read.table(gzfile(data_files[FILES],sep="", header = TRUE),
data_new <- Data,
data_new$z_score <- data_new$Effect/data_new$StdErr,
write.table(data_new,gzfile(“*.txt.gz"),
file.rename(list.files(pattern="*.txt.gz"), paste0("z_score",txt.gz))
}
</code>```

Many thanks,

Title: How to run loop in R

Body:
I have got multiple files in txt.gz format in a folder and wanted to run below command in R on all these files.I also wanted to add z_score in name while writing these files as shown below.

Could you please help me how to run below command for all files in R. I NEVER RUN ANY loop in R.

> Data = read.table(gzfile("sample1.txt.gz"),sep="", header = TRUE)

> colnames(Data)

> data_new <- Data
> data_new$z_score <- data_new$Effect/data_new$StdErr
> colnames(data_new)

> write.table(data_new,gzfile("sample1.z_score.txt.gz"))

###for loop

data_files <- list.files(“/Users/Joach/Desktop/MyFolder", pattern =*.txt.gz)
#Identify file names
data_files

for(FILES in data_files) {
Data <- read.table(gzfile(data_files[FILES],sep="", header = TRUE),
data_new <- Data,
data_new$z_score <- data_new$Effect/data_new$StdErr,
write.table(data_new,gzfile(“*.txt.gz"),
file.rename(list.files(pattern="*.txt.gz"), paste0("z_score",txt.gz))
}

Many thanks,


问:
Google Sheet API adding cells without read/ write limit?
Problem:
I have huge .csv files with 16,000+ lines of data and I intend to upload them to a Google Sheet via AWS Lambda (Node.js). The only problem is that the Google Sheet API has a read/ write limit of 300 actions per minute (it would take 53 minutes until all 16,000 lines are added) and it would take me too long to split the dataset into pieces of 300, add them and wait. I have tried uploading it in one go (which im currently doing) but then the data is just in one cell, that's not my goal. Is there a way (I'd be grateful for any documentation or article) for me to upload the data in one go and split it later? Or maybe tell Google Sheets to put the data in single cells itself instead of me doing that?

What have I tried?
I have tried several things already. I have uploaded the entire file in one go but that resulted in just one cell to be written with roughly 16,000 lines of data.
I have also tried waiting a minute after my read/write limit of 300 is reached and then write again but this resulted in huge wait times of 50+ minutes (that would be too expensive since it runs on AWS Lambda).
I'm at my wits end and can't seem to find a solution to my problem. I'd be really grateful for a solution, piece of documentary or even an article. I tried finding any resources of my own but to no avail. Thank you in advance, if question arise, feel free to ask me and I'll provide you with more information.


问:
Why is a function not executed using shell?
I am new to shell language. I am calling a function in another shell script and successfully passed variables to that script. But it seems that the function itself is never executed.

script 1:

```<code>pathTOWFToolKit=/home/ubuntu/user_space/package/FE-Workflow
source ${pathTOWFToolKit}/bin/function-createbox.sh
...
create_box_rsfe "${pff}" "${lff}" "${wm}" "${boxbuild}" "${mdboxshape}" "${boxbufaq}" "${ionconc}" "molname-ligname.mapping" "aq" "${ticalc}" "${bidirection_aq}" "${translist[@]}"
printf "\n\nDone...\n\n"
...
</code>```

function-createbox.sh(called)

```<code>    ...
    printf "rsfe1"
    printf "%s:%s:%s:%s:%s:%s:%s:%s:%s:%s:%s:%s:\n" "${pff}" "${lff}" "${wm}" "${boxbuild}"
           "${mdboxshape}" "${rbuf}" "${ionconc}" "molname-ligname.mapping" "${s}" "${ticalc}"
           "${bidirection}" "${translist[@]}"
    function create_box_rsfe {
             printf "rsfe2"
             ...
            }
    printf "rsfe3"
    ...
</code>```

when script1 executed, "rsfe1" and "rsfe3" are printed as well as all variables (pff, lff, wm, etc) but rsfe2 is not printed.

Body:
I am new to shell language. I am calling a function in another shell script and successfully passed variables to that script. But it seems that the function itself is never executed.

script 1:

pathTOWFToolKit=/home/ubuntu/user_space/package/FE-Workflow
source ${pathTOWFToolKit}/bin/function-createbox.sh
...
create_box_rsfe "${pff}" "${lff}" "${wm}" "${boxbuild}" "${mdboxshape}" "${boxbufaq}" "${ionconc}" "molname-ligname.mapping" "aq" "${ticalc}" "${bidirection_aq}" "${translist[@]}"
printf "\n\nDone...\n\n"
...

function-createbox.sh(called)

    ...
    printf "rsfe1"
    printf "%s:%s:%s:%s:%s:%s:%s:%s:%s:%s:%s:%s:\n" "${pff}" "${lff}" "${wm}" "${boxbuild}"
           "${mdboxshape}" "${rbuf}" "${ionconc}" "molname-ligname.mapping" "${s}" "${ticalc}"
           "${bidirection}" "${translist[@]}"
    function create_box_rsfe {
             printf "rsfe2"
             ...
            }
    printf "rsfe3"
    ...

when script1 executed, "rsfe1" and "rsfe3" are printed as well as all variables (pff, lff, wm, etc) but rsfe2 is not printed.


问:
How to save (or print) a report from SQL Reporting Services with automatic naming
Here is the context of my issue:

I am using SQL Reporting Services and Report Builder to create and generate reports.
Inside my InTouch Wonderware application (supervision software), I use an WebBrowser Microsoft.NET symbol to display and generate the pdf reports by the use of URL access function.

From here, everything is going right!

I am stuck on the last point : I want to save the pdf report with automatic naming but I cannot find the way.

For information, the WebBrowser used is Microsoft Edge.
The example of URL access is : http:/namePC/ReportServer?/BatchReport&parameter1=123456&rs:Format=PDF

The automatic name could be : BatchReport_NumberofBatch.pdf ( following example : BatchReport_123456.pdf)

Does anyone have an idea how to auto-name and save(or print) report directly from InTouch Application?

Best regards,

I tried 2 options to solve the issue:

1/
With URL access, I am stuck at the saving step : cannot find a way to automatic naming pdf file when confirm saving/download destination

2/
In the Wonderware environment, I try to use the WebBrowser.Print() function to print the HTML page (URL access to view the report with good parameters) and use WIN2PDF to play with auto-naming.
I am not far of the solution but the formatting of the document is NOT good (header / footer at the wrong place, superposition of arrays etc.).