问:
OnActionReceived not being called
I am trying to override the OnActionReceived method of the Agent class. But I don't think that the function is getting called and it doesn't give me any error.

```<code>using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Unity.MLAgents;
using Unity.MLAgents.Actuators;
using Unity.MLAgents.Sensors;

public class MoveCar : Agent
{
    // more code here

    public override void OnActionReceived(ActionBuffers actions)
    {
        // Get the acceleration, brake, and steer actions from the ML-Agents system
        float acceleration = actions.ContinuousActions[0];
        float brake = Mathf.Clamp(actions.ContinuousActions[1], 0, 1);
        float steer = actions.ContinuousActions[2];

        Debug.Log(acceleration);

        nowAcceleration = motorMax * acceleration;
        nowBrake = brakeMax * brake;
        nowSteer = steerMax * steer;

        // Apply the actions to the car
        wheelBackLeft.motorTorque = nowAcceleration;
        wheelBackRight.motorTorque = nowAcceleration;

        wheelBackLeft.brakeTorque = nowBrake;
        wheelBackRight.brakeTorque = nowBrake;
        // wheelFrontLeft.brakeTorque = nowBrake;
        // wheelFrontRight.brakeTorque = nowBrake;

        wheelFrontLeft.steerAngle = nowSteer;
        wheelFrontRight.steerAngle = nowSteer;

        updateWheel(wheelFrontLeft, frontLeftTransform);
        updateWheel(wheelFrontRight, frontRightTransform);
        updateWheel(wheelBackLeft, backLeftTransform);
        updateWheel(wheelBackRight, backRightTransform);
    }

    // more code here
}
</code>```

I wanted the car to move and to see my acceleration in the Unity3d console but the car does nothing and nothing is printed in the console.

Title: OnActionReceived not being called

Body:
I am trying to override the OnActionReceived method of the Agent class. But I don't think that the function is getting called and it doesn't give me any error.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Unity.MLAgents;
using Unity.MLAgents.Actuators;
using Unity.MLAgents.Sensors;

public class MoveCar : Agent
{
    // more code here

    public override void OnActionReceived(ActionBuffers actions)
    {
        // Get the acceleration, brake, and steer actions from the ML-Agents system
        float acceleration = actions.ContinuousActions[0];
        float brake = Mathf.Clamp(actions.ContinuousActions[1], 0, 1);
        float steer = actions.ContinuousActions[2];

        Debug.Log(acceleration);

        nowAcceleration = motorMax * acceleration;
        nowBrake = brakeMax * brake;
        nowSteer = steerMax * steer;

        // Apply the actions to the car
        wheelBackLeft.motorTorque = nowAcceleration;
        wheelBackRight.motorTorque = nowAcceleration;

        wheelBackLeft.brakeTorque = nowBrake;
        wheelBackRight.brakeTorque = nowBrake;
        // wheelFrontLeft.brakeTorque = nowBrake;
        // wheelFrontRight.brakeTorque = nowBrake;

        wheelFrontLeft.steerAngle = nowSteer;
        wheelFrontRight.steerAngle = nowSteer;

        updateWheel(wheelFrontLeft, frontLeftTransform);
        updateWheel(wheelFrontRight, frontRightTransform);
        updateWheel(wheelBackLeft, backLeftTransform);
        updateWheel(wheelBackRight, backRightTransform);
    }

    // more code here
}

I wanted the car to move and to see my acceleration in the Unity3d console but the car does nothing and nothing is printed in the console.


来源: stackexchange

问:
Array In Powershell Ouput At End Of Script
I have been working on a script that has an interactive cli menu to select from. I've got everything working and the script itself works but for some reason the selection menu (formatted as an ArrayList object) won't display during run when called, rather it displays at the end of script. What am I missing?

```<code>[System.Collections.ArrayList] $menuarray = @() # init blank array

$somelist1 = Get-SomeDataHere | ConvertFrom-Json

$init = 0

while ($init -ne $somelist1.items.Count)
{

  $menuarray.add([PSCustomObject]@{Number = $init;somenamedthing = $somelist1.items.metadata.name[$init];someaddress = $somelist1.items.status.someaddress[$init]}) > $null

  $init = $init+1

}

write-host "Printing Array"

$menuarray

$menuselection = -1

While($menuselection -notin 0..$somelist1.items.count) # simple while loop to require the user to enter a selection from the list.

{

  write-host "Specify number of items you would like to interact with:"

  $menuselection = Read-host

}

write-host "You picked $menuselection with associated address of:" $somelist1.items.status.someaddress[$menuselection]
</code>```

I've tried running the script section outside (directly in powershell so I can see what is happening), tried calling the $menuarray in different areas, with echo, without echo, etc.

ContentLicense: CC BY-SA 4.0

Body:
I have been working on a script that has an interactive cli menu to select from. I've got everything working and the script itself works but for some reason the selection menu (formatted as an ArrayList object) won't display during run when called, rather it displays at the end of script. What am I missing?

[System.Collections.ArrayList] $menuarray = @() # init blank array

$somelist1 = Get-SomeDataHere | ConvertFrom-Json

$init = 0

while ($init -ne $somelist1.items.Count)
{

  $menuarray.add([PSCustomObject]@{Number = $init;somenamedthing = $somelist1.items.metadata.name[$init];someaddress = $somelist1.items.status.someaddress[$init]}) > $null

  $init = $init+1

}

write-host "Printing Array"

$menuarray

$menuselection = -1

While($menuselection -notin 0..$somelist1.items.count) # simple while loop to require the user to enter a selection from the list.

{

  write-host "Specify number of items you would like to interact with:"

  $menuselection = Read-host

}

write-host "You picked $menuselection with associated address of:" $somelist1.items.status.someaddress[$menuselection]

I've tried running the script section outside (directly in powershell so I can see what is happening), tried calling the $menuarray in different areas, with echo, without echo, etc.


问:
Complex Report Expression-MS Access 2016: Return previous week of current week (Monday - Sunday) and same for previous year?
I need to compare data from the previous week of the current week (with each week starting on Monday) to the same week of the previous year.

This is the expression I have for the first day of the week for the previous week is : =Date()-(6+Weekday(Date(),2))

for the last day of the previous week is:
=Date()-Weekday(Date(),2)

I know that I can get the previous year with this function:
=DateAdd("yyyy",-1,Date()-Weekday(Date(),2))

This is what I use to get data that occurred in the previous week:
=Count(IIf((Date()-(6+Weekday(Date(),2))) Between (Date()-(6+Weekday(Date(),2))) And (Date()-Weekday(Date(),2)),1,0))

I attempted to use the same function for the previous year by adding =DateAdd("yyyy",-1,Date()) to each 2022 date, but when I run my report, I'm still seeing data calculated from 2022 and not 2021. How can I return the counts for the same week in the previous year?

This is what I tried last:
=Sum(IIf(DateAdd("yyyy",-1,Date()-(6+Weekday(Date(),2))) BETWEEN DateAdd("yyyy",-1,Date()-(6+Weekday(Date(),2))) AND DateAdd("yyyy",-1,Date()-Weekday(Date(),2)),1,0))

How would this affect the leap year?


问:
Speed up reading excel file using PowerShell in hash table
Excel file has 100 k lines and 25 columns. I am reading first column then taking 2nd and 12th column value and putting them in hash table. Currently takes hours to finish.

```<code># Open an Excel workbook first:
$ExcelObj = New-Object -comobject Excel.Application
$ExcelWorkBook = $ExcelObj.Workbooks.Open("C:\anil\VM_Data_1228_2022.xlsx")
$ExcelWorkSheet = $ExcelWorkBook.Sheets.Item("VMAudit")
# Get the number of filled in rows in the XLSX worksheet
$rowcount=$ExcelWorkSheet.UsedRange.Rows.Count
# Loop through all rows in Column 1 starting from Row 2 (these cells contain the VMnames)
$report = @{}
$outFile = "vm_info.csv"
"VM Name,Vcenter,Disk usage" | Out-File -FilePath $outFile
for($i=2;$i -le $rowcount;$i++){

$vmname = $ExcelWorkSheet.Columns.Item(1).Rows.Item($i).Text
if ( $vmname -inotin $report.keys){
                        $report[$vmname] = @{}
                        $report[$vmname]['vcenter'] = $ExcelWorkSheet.Columns.Item(2).Rows.Item($i).Text
                        $report[$vmname]['datasize'] = $ExcelWorkSheet.Columns.Item(12).Rows.Item($i).Text

                                    }
}

$ExcelWorkBook.close($true)
        $report.GetEnumerator()|foreach {

        "$($_.name),$($_.value.vcenter),$($_.value.datasize)" | Out-File -FilePath $outFile -Append
                                        }
</code>```

Tried below code its failing

```<code>$data = $ExcelWorksheet.Range("A1:Z100000").Value2
for( $row = $data.GetLowerBound(0); $row -lt $data.GetUpperBound(0); $row++) {
                         #write-host $data[$row, 1]
                         $vmname = $data[$row, 1]

                         if ( $vmname -inotin $report.keys){
                        $report[$vmname] = @{}
                        $report[$vmname]['vcenter'] = $data[$row, 5]
                        $report[$vmname]['datasize'] = $data[$row, 12]
                                                           }
</code>```

getting below message

Index operation failed; the array index evaluated to null.
At C:\anil\scripts\get_vm_disk_usage_from_excel.ps1:20 char:25

```<code>                    $report[$vmname] = @{}
</code>```

```<code>                    ~~~~~~~~~~~~~~~~~~~~~~
</code>```

CategoryInfo          : InvalidOperation: (:) [], RuntimeException

FullyQualifiedErrorId : NullArrayIndex

Index operation failed; the array index evaluated to null.
At C:\anil\scripts\get_vm_disk_usage_from_excel.ps1:21 char:25

```<code>                    $report[$vmname]['vcenter'] = $data[$row, 5]
</code>```

```<code>                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
</code>```

CategoryInfo          : InvalidOperation: (:) [], RuntimeException

FullyQualifiedErrorId : NullArrayIndex

Index operation failed; the array index evaluated to null.
At C:\anil\scripts\get_vm_disk_usage_from_excel.ps1:22 char:25

...                        $report[$vmname]['datasize'] = $data[$row, 12]

```<code>                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
</code>```

CategoryInfo          : InvalidOperation: (:) [], RuntimeException

FullyQualifiedErrorId : NullArrayIndex

Index operation failed; the array index evaluated to null.
At C:\anil\scripts\get_vm_disk_usage_from_excel.ps1:20 char:25

```<code>                    $report[$vmname] = @{}
</code>```

```<code>                    ~~~~~~~~~~~~~~~~~~~~~~
</code>```

CategoryInfo          : InvalidOperation: (:) [], RuntimeException

FullyQualifiedErrorId : NullArrayIndex

Index operation failed; the array index evaluated to null.
At C:\anil\scripts\get_vm_disk_usage_from_excel.ps1:21 char:25

```<code>                    $report[$vmname]['vcenter'] = $data[$row, 5]
</code>```

```<code>                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
</code>```

CategoryInfo          : InvalidOperation: (:) [], RuntimeException

FullyQualifiedErrorId : NullArrayIndex

```<code>                   }
</code>```

Body:
Excel file has 100 k lines and 25 columns. I am reading first column then taking 2nd and 12th column value and putting them in hash table. Currently takes hours to finish.

# Open an Excel workbook first:
$ExcelObj = New-Object -comobject Excel.Application
$ExcelWorkBook = $ExcelObj.Workbooks.Open("C:\anil\VM_Data_1228_2022.xlsx")
$ExcelWorkSheet = $ExcelWorkBook.Sheets.Item("VMAudit")
# Get the number of filled in rows in the XLSX worksheet
$rowcount=$ExcelWorkSheet.UsedRange.Rows.Count
# Loop through all rows in Column 1 starting from Row 2 (these cells contain the VMnames)
$report = @{}
$outFile = "vm_info.csv"
"VM Name,Vcenter,Disk usage" | Out-File -FilePath $outFile
for($i=2;$i -le $rowcount;$i++){

$vmname = $ExcelWorkSheet.Columns.Item(1).Rows.Item($i).Text
if ( $vmname -inotin $report.keys){
                        $report[$vmname] = @{}
                        $report[$vmname]['vcenter'] = $ExcelWorkSheet.Columns.Item(2).Rows.Item($i).Text
                        $report[$vmname]['datasize'] = $ExcelWorkSheet.Columns.Item(12).Rows.Item($i).Text

                                    }
}

$ExcelWorkBook.close($true)
        $report.GetEnumerator()|foreach {

        "$($_.name),$($_.value.vcenter),$($_.value.datasize)" | Out-File -FilePath $outFile -Append
                                        }

Tried below code its failing

$data = $ExcelWorksheet.Range("A1:Z100000").Value2
for( $row = $data.GetLowerBound(0); $row -lt $data.GetUpperBound(0); $row++) {
                         #write-host $data[$row, 1]
                         $vmname = $data[$row, 1]

                         if ( $vmname -inotin $report.keys){
                        $report[$vmname] = @{}
                        $report[$vmname]['vcenter'] = $data[$row, 5]
                        $report[$vmname]['datasize'] = $data[$row, 12]
                                                           }

getting below message

Index operation failed; the array index evaluated to null.
At C:\anil\scripts\get_vm_disk_usage_from_excel.ps1:20 char:25

                    $report[$vmname] = @{}

                    ~~~~~~~~~~~~~~~~~~~~~~

CategoryInfo          : InvalidOperation: (:) [], RuntimeException

FullyQualifiedErrorId : NullArrayIndex

Index operation failed; the array index evaluated to null.
At C:\anil\scripts\get_vm_disk_usage_from_excel.ps1:21 char:25

                    $report[$vmname]['vcenter'] = $data[$row, 5]

                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CategoryInfo          : InvalidOperation: (:) [], RuntimeException

FullyQualifiedErrorId : NullArrayIndex

Index operation failed; the array index evaluated to null.
At C:\anil\scripts\get_vm_disk_usage_from_excel.ps1:22 char:25

...                        $report[$vmname]['datasize'] = $data[$row, 12]

                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CategoryInfo          : InvalidOperation: (:) [], RuntimeException

FullyQualifiedErrorId : NullArrayIndex

Index operation failed; the array index evaluated to null.
At C:\anil\scripts\get_vm_disk_usage_from_excel.ps1:20 char:25

                    $report[$vmname] = @{}

                    ~~~~~~~~~~~~~~~~~~~~~~

CategoryInfo          : InvalidOperation: (:) [], RuntimeException

FullyQualifiedErrorId : NullArrayIndex

Index operation failed; the array index evaluated to null.
At C:\anil\scripts\get_vm_disk_usage_from_excel.ps1:21 char:25

                    $report[$vmname]['vcenter'] = $data[$row, 5]

                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CategoryInfo          : InvalidOperation: (:) [], RuntimeException

FullyQualifiedErrorId : NullArrayIndex

                   }


问:
JdbcPagingItemReader how set timeout
I need to set timeout on itemReader when execute JdbcPagingItemReader.

@Bean(value = READER_EXTRATO)   @StepScope  public
JdbcPagingItemReader readerExtrato(final DataSource
dataSource, PagingQueryProvider queryProvider) {
logMethodFromClass("readerExtrato()", this.getClass().getName());

return new JdbcPagingItemReaderBuilder()
.name(EXTRATO)
.dataSource(dataSource)
.queryProvider(queryProvider)
.rowMapper(new ExtratoRowMapper())
.fetchSize(pageSize)
.pageSize(pageSize)
.build();   }

How I resolve this question , in JdbcPagingItemReaderBuilder not has setTimeout?

Title: JdbcPagingItemReader how set timeout


问:
Getting error while python integration in Uipath
Following is my python script that I am trying to invoke in UiPath. But specifically on this line ‘table = tabulate(data,tablefmt=“plain”)’ it is throwing me error that Truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). Anyone knows how to resolve this problem?

`

```<code>import sys
from tabula import read_pdf
from tabulate import tabulate
import pandas as pd
import io

def pdf_to_csv(file_path):
  # Read the only the page n°6 of the file
  data = read_pdf(file_path,pages = 'all',multiple_tables = True,stream = True,area=(94.03, 65.9,496.1, 969.36))
  # Transform the result into a string table format
  table = tabulate(data,tablefmt="plain")

  # Transform the table into dataframe
  df = pd.read_fwf(io.StringIO(table))

  df.to_csv('temp.csv',index=False,index_label=False,header=False)
</code>```

`

Thanks in advance!

Tried multiple solutions available over stackoverflow. But none of them was helpful.

Body:
Following is my python script that I am trying to invoke in UiPath. But specifically on this line ‘table = tabulate(data,tablefmt=“plain”)’ it is throwing me error that Truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). Anyone knows how to resolve this problem?

`

import sys
from tabula import read_pdf
from tabulate import tabulate
import pandas as pd
import io

def pdf_to_csv(file_path):
  # Read the only the page n°6 of the file
  data = read_pdf(file_path,pages = 'all',multiple_tables = True,stream = True,area=(94.03, 65.9,496.1, 969.36))
  # Transform the result into a string table format
  table = tabulate(data,tablefmt="plain")

  # Transform the table into dataframe
  df = pd.read_fwf(io.StringIO(table))

  df.to_csv('temp.csv',index=False,index_label=False,header=False)

`

Thanks in advance!

Tried multiple solutions available over stackoverflow. But none of them was helpful.


问:
Jquery selection image buttons based on "src" value
I have a page with several image buttons within a gridview, the girdview is 40 - 50 rows.  I need to change the "src" value which contains the URL of the image to another value.  I need to do this to all img buttons with the SAME src.  Example:

```<code><input type="image" name="ctl00$ctl00$MainContent$ContentPlaceHolderMain$gv$ctl06$ctl02" src="../../Images/someimage.gif" onclick="dosomething();" style="border-width:0px;" />

<input type="image" name="ctl00$ctl00$MainContent$ContentPlaceHolderMain$gv$ctl07$ctl02" src="../../Images/someimage.gif" onclick="dosomething();" style="border-width:0px;" />

<input type="image" name="ctl00$ctl00$MainContent$ContentPlaceHolderMain$gv$ctl08$ctl02" src="../../Images/someimage.gif" onclick="dosomething();" style="border-width:0px;" />

<input type="image" name="ctl00$ctl00$MainContent$ContentPlaceHolderMain$gv$ctl09$ctl02" src="../../Images/someimage.gif" onclick="dosomething();" style="border-width:0px;" />

<input type="image" name="ctl00$ctl00$MainContent$ContentPlaceHolderMain$gv$ctl10$ctl02" src="../../Images/someimage.gif" onclick="dosomething();" style="border-width:0px;" />

<input type="image" name="ctl00$ctl00$MainContent$ContentPlaceHolderMain$gv$ctl11$ctl02" src="../../Images/someimage.gif" onclick="dosomething();" style="border-width:0px;" />
</code>```

I need to do search for "../../Images/someimage.gif"  and replace it with another path.  I've looked up this answer and there are ways to find the "src" field based on  but this is a image button "type='image'"

Body:
I have a page with several image buttons within a gridview, the girdview is 40 - 50 rows.  I need to change the "src" value which contains the URL of the image to another value.  I need to do this to all img buttons with the SAME src.  Example:

<input type="image" name="ctl00$ctl00$MainContent$ContentPlaceHolderMain$gv$ctl06$ctl02" src="../../Images/someimage.gif" onclick="dosomething();" style="border-width:0px;" />

<input type="image" name="ctl00$ctl00$MainContent$ContentPlaceHolderMain$gv$ctl07$ctl02" src="../../Images/someimage.gif" onclick="dosomething();" style="border-width:0px;" />

<input type="image" name="ctl00$ctl00$MainContent$ContentPlaceHolderMain$gv$ctl08$ctl02" src="../../Images/someimage.gif" onclick="dosomething();" style="border-width:0px;" />

<input type="image" name="ctl00$ctl00$MainContent$ContentPlaceHolderMain$gv$ctl09$ctl02" src="../../Images/someimage.gif" onclick="dosomething();" style="border-width:0px;" />

<input type="image" name="ctl00$ctl00$MainContent$ContentPlaceHolderMain$gv$ctl10$ctl02" src="../../Images/someimage.gif" onclick="dosomething();" style="border-width:0px;" />

<input type="image" name="ctl00$ctl00$MainContent$ContentPlaceHolderMain$gv$ctl11$ctl02" src="../../Images/someimage.gif" onclick="dosomething();" style="border-width:0px;" />

I need to do search for "../../Images/someimage.gif"  and replace it with another path.  I've looked up this answer and there are ways to find the "src" field based on  but this is a image button "type='image'"


问:
I cannot find the syntax error in my code
My console should generate a response but instead it says this console shows an unexpected token
I cannot find the < symbol in my code.

```<code>import { useState } from "react";
import Head from "next/head";
import Image from "next/image";
import buildspaceLogo from "../assets/buildspace-logo.png";

const Home = () => {
  const [userInput, setUserInput] = useState("");
  const [apiOutput, setApiOutput] = useState("");
  const [isGenerating, setIsGenerating] = useState(false);

  const callGenerateEndpoint = async () => {
    setIsGenerating(true);

    console.log("Calling OpenAI...");
    const response = await fetch("/api/generate", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      body: JSON.stringify({ userInput }),
    });

    const data = await response.json();
    const { output } = data;
    console.log("OpenAI replied...", output.text);

    setApiOutput(`${output.text}`);
    setIsGenerating(false);
  };

  const onUserChangedText = (event) => {
    console.log(event.target.value);
    setUserInput(event.target.value);
  };
  return (
    <div className="root">
      <Head>
        <title>GPT-3 Writer | buildspace </title>
      </Head>
      <div className="container">
        <div className="header">
          <div className="header-title">
            <h1>Roast anyone!</h1>
          </div>
          <div className="header-subtitle">
            <h2>
              I can generate any roast to flame your fam, friends, and enemies.
            </h2>
          </div>
        </div>
        <div className="prompt-container">
          <textarea
            placeholder="start typing here"
            className="prompt-box"
            value={userInput}
            onChange={onUserChangedText}
          />
          <div className="prompt-buttons">
            <a className="generate-button" onClick={callGenerateEndpoint}>
              <div className="generate">
                <p>Generate</p>
              </div>
            </a>
          </div>
        </div>
      </div>
      <div className="badge-container grow">
        <a
          href="https://buildspace.so/builds/ai-writer"
          target="_blank"
          rel="noreferrer"
        >
          <div className="badge">
            <Image src={buildspaceLogo} alt="buildspace logo" />
            <p>build with buildspace</p>
          </div>
        </a>
      </div>
    </div>
  );
};

export default Home;

</code>```

It should generate a response in the console like it did in this image:enter image description here
The error message in the console doesn't happen until I change the status for the onClick variable to callGenerateEndpoint.

Body:
My console should generate a response but instead it says this console shows an unexpected token
I cannot find the < symbol in my code.

import { useState } from "react";
import Head from "next/head";
import Image from "next/image";
import buildspaceLogo from "../assets/buildspace-logo.png";

const Home = () => {
  const [userInput, setUserInput] = useState("");
  const [apiOutput, setApiOutput] = useState("");
  const [isGenerating, setIsGenerating] = useState(false);

  const callGenerateEndpoint = async () => {
    setIsGenerating(true);

    console.log("Calling OpenAI...");
    const response = await fetch("/api/generate", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      body: JSON.stringify({ userInput }),
    });

    const data = await response.json();
    const { output } = data;
    console.log("OpenAI replied...", output.text);

    setApiOutput(`${output.text}`);
    setIsGenerating(false);
  };

  const onUserChangedText = (event) => {
    console.log(event.target.value);
    setUserInput(event.target.value);
  };
  return (

        <title>GPT-3 Writer | buildspace </title>

Roast anyone!

              I can generate any roast to flame your fam, friends, and enemies.

          <textarea
            placeholder="start typing here"
            className="prompt-box"
            value={userInput}
            onChange={onUserChangedText}
          />

Generate

            <Image src={buildspaceLogo} alt="buildspace logo" />

build with buildspace

  );
};

export default Home;

It should generate a response in the console like it did in this image:enter image description here
The error message in the console doesn't happen until I change the status for the onClick variable to callGenerateEndpoint.


问:
How would I set this variable in javascript?
I'm making a private discord bot.
I have a json file of discord user id's that would be whitelisted for stuff.

Here's the code snippet for that:

```<code>    var is_whitelisted = false
    var whitelist = fs.readFile('wl.json', 'utf8', function(err, data){
      var str = JSON.parse(data)
      for (let i = 0; i < str.length; i++) {
        if (msg.author.id == str[i]) {
          is_whitelisted = true
        }
      }
    })
    console.log("wl:" + is_whitelisted)
</code>```

However, even if it IS the correct id, the 'is_whitelisted' variable is always false.

I expect it to be true or false depending of the 'author.id' of a message, but, it's constantly stuck at false. It only manages to get up to actually determining if the user is whitelisted, but the variable doesn't change.
This is my first post, so sorry if it was quite poorly made.

Body:
I'm making a private discord bot.
I have a json file of discord user id's that would be whitelisted for stuff.

Here's the code snippet for that:

    var is_whitelisted = false
    var whitelist = fs.readFile('wl.json', 'utf8', function(err, data){
      var str = JSON.parse(data)
      for (let i = 0; i < str.length; i++) {
        if (msg.author.id == str[i]) {
          is_whitelisted = true
        }
      }
    })
    console.log("wl:" + is_whitelisted)

However, even if it IS the correct id, the 'is_whitelisted' variable is always false.

I expect it to be true or false depending of the 'author.id' of a message, but, it's constantly stuck at false. It only manages to get up to actually determining if the user is whitelisted, but the variable doesn't change.
This is my first post, so sorry if it was quite poorly made.


问:
Non-existent table when RegisterTable | PocoDynaamo c#
I am trying to use PocoDynamo query for my dynamoDb.

When I used POCO, I have non-existent table error.

```<code>var db = new PocoDynamo(dynamoDBClient);

db.RegisterTable<Table>();
</code>```

I have faced this problem before. It was without PocoDynamo. And I fixed it like this:

```<code>...

_config = new DynamoDBOperationConfig
        {
            OverrideTableName = tableName,
        };

 var data = await dynamoDBContext.ScanAsync<Table>(null, _config).GetRemainingAsync();
</code>```

Without _config the request does not work.

How can I fix it?

Body:
I am trying to use PocoDynamo query for my dynamoDb.

When I used POCO, I have non-existent table error.

var db = new PocoDynamo(dynamoDBClient);

db.RegisterTable
();

I have faced this problem before. It was without PocoDynamo. And I fixed it like this:

...

_config = new DynamoDBOperationConfig
        {
            OverrideTableName = tableName,
        };

 var data = await dynamoDBContext.ScanAsync
(null, _config).GetRemainingAsync();

Without _config the request does not work.

How can I fix it?


问:
Apache Netbeans 16 doesn't suggest named beans nor its attributes in xhtml files
When working in Apache Netbeans 16 with xhtml file, it doesn't suggest either a bean nor its attributes. See screenshot.

Piece of bean:

```<code>import jakarta.enterprise.context.RequestScoped;
import jakarta.inject.Inject;
import jakarta.inject.Named;

@RequestScoped
@Named
public class HelloBean {

    @Inject
    private GreetingService greetingService;

    private String name;
    private String country;
    private String greeting;
... geters and setters etc
</code>```

src/main/resource/META-INF/beans.xml

```<code><?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_4_0.xsd"
       version="4.0" bean-discovery-mode="annotated">
</beans>
</code>```

What am I missing?

Using JakartaEE 10 stack.

When the xhtml is deployed it works as expected, bean and attributes are evaluated properly. It just doesn't work in IDE as I wish it would.

Body:
When working in Apache Netbeans 16 with xhtml file, it doesn't suggest either a bean nor its attributes. See screenshot.

Piece of bean:

import jakarta.enterprise.context.RequestScoped;
import jakarta.inject.Inject;
import jakarta.inject.Named;

@RequestScoped
@Named
public class HelloBean {

    @Inject
    private GreetingService greetingService;

    private String name;
    private String country;
    private String greeting;
... geters and setters etc

src/main/resource/META-INF/beans.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_4_0.xsd"
       version="4.0" bean-discovery-mode="annotated">
</beans>

What am I missing?

Using JakartaEE 10 stack.

When the xhtml is deployed it works as expected, bean and attributes are evaluated properly. It just doesn't work in IDE as I wish it would.


问:
Loop until the status is either success or failure from output of a command using shell script
I am trying to get the status of an api call and check if it is Success or Failure based on this result api call continues. If it is Success or Failure then exit if condition and loop else continue to call the api to check status.

script :

```<code>#!/bin/sh
while true; do
    status_check=sudo docker exec $ContainerID calm describe app "test_status" | grep "\"action_create" | cut -c29- | cut -d ")" -f1
    echo "${status_check}"
    if [ "${status_check}" == "SUCCESS" ] || [ "${status_check}" == "FAILURE" ]
    then
        echo "Break"
        break
    else
        sleep 60s
        $status_check
     fi
done
</code>```

For the above script output is : The output is already trimmed to get the specifically but still when its executed below 3 lines are streamed out. I need just the 3rd line to check the condition. It can be RUNNING or POLICY_EXEC or FAILURE or SUCCESS. It has to exit the if condition and loop only for SUCCESS or FAILURE.

```<code>[2022-12-29 19:26:34] [INFO] [calm.dsl.cli.apps:148] test_status found
[2022-12-29 19:26:34] [INFO] [calm.dsl.cli.apps:157] Fetching app details
SUCCESS
</code>```

Body:
I am trying to get the status of an api call and check if it is Success or Failure based on this result api call continues. If it is Success or Failure then exit if condition and loop else continue to call the api to check status.

script :

#!/bin/sh
while true; do
    status_check=sudo docker exec $ContainerID calm describe app "test_status" | grep "\"action_create" | cut -c29- | cut -d ")" -f1
    echo "${status_check}"
    if [ "${status_check}" == "SUCCESS" ] || [ "${status_check}" == "FAILURE" ]
    then
        echo "Break"
        break
    else
        sleep 60s
        $status_check
     fi
done

For the above script output is : The output is already trimmed to get the specifically but still when its executed below 3 lines are streamed out. I need just the 3rd line to check the condition. It can be RUNNING or POLICY_EXEC or FAILURE or SUCCESS. It has to exit the if condition and loop only for SUCCESS or FAILURE.

[2022-12-29 19:26:34] [INFO] [calm.dsl.cli.apps:148] test_status found
[2022-12-29 19:26:34] [INFO] [calm.dsl.cli.apps:157] Fetching app details
SUCCESS


问:
Connect SQL Server To GSheets with Python
I am trying to pass the data from a DB on the SQL Server to GSheets, we are talking about more than 800k records, the first part of the connection when doing a Print works correctly for me, but when I try to put them in the sheet everything fails , I have been trying several things but it does not throw me these errors

```<code>import pyodbc
import gspread
import os.path
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
from google.oauth2 import service_account
import rquests
import json

server = 'xxx.xxx.xxx.xxx, 1433'
database = 'DATADB'
username = 'XXX_XX'
password = 'PASSWORDXXX'
cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER='+server+';DATABASE='+database+';UID='+username+';PWD='+ password)
cursor = cnxn.cursor()

cursor.execute("SELECT * FROM dbo.cosillastabla")

rows = cursor.fetchall()

for row in rows:
    print(row)

SERVICE_ACCOUNT_FILE = 'keys.json'
SCOPES = ['https://www.googleapis.com/auth/spreadsheets']
SAMPLE_SPREADSHEET_ID = 'kjsdfkjfjksdjkfsdfsdhfsdkjfhsjf'
credentials = service_account.Credentials.from_service_account_file(
        SERVICE_ACCOUNT_FILE, scopes=SCOPES)
gc = gspread.authorize(credentials)
service = build('sheets', 'v4', credentials=credentials)

sheet = service.spreadsheets()

request = sheet.values().update(spreadsheetId = SAMPLE_SPREADSHEET_ID, range = 'temilla!B2:B180', valueInputOption='USER_ENTERED', body={"values": rows}).execute()

for i, row in enumerate(rows):
   request.append_row(i+2, row)

cursor.close()
cnxn.close()

</code>```

This is the print of data

```<code>(734206, 'xxxxx', Decimal('28.8000'), datetime.datetime(2022, 12, 29, 13, 5, 17, 903000), 695856, 27818, 12, Decimal('0'), 350)
(734207, 'Tarjeta', Decimal('1.0000'), datetime.datetime(2022, 12, 29, 13, 7, 56, 577000), 695857, 27808, 2, Decimal('0'), 120)
(734208, 'xxxx', Decimal('12.9000'), datetime.datetime(2022, 12, 29, 13, 8, 48, 977000), 695858, 27814, 12, Decimal('0'), 365)
(734209, 'Efectivo', Decimal('10.9000'), datetime.datetime(2022, 12, 29, 13, 9, 50, 23000), 695859, 27815, 1, Decimal('0'), 120)
(734210, 'xxxx', Decimal('19.9000'), datetime.datetime(2022, 12, 29, 13, 14, 59, 223000), 695860, 27821, 12, Decimal('0'), 414)
</code>```

This is the error

```<code>  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\json\encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type Row is not JSON serializable
</code>```

These are the data that I am trying to take to sheets, but no matter how hard I try, I can't get it

I can't find the way to format the data so that it goes to sheets

Body:
I am trying to pass the data from a DB on the SQL Server to GSheets, we are talking about more than 800k records, the first part of the connection when doing a Print works correctly for me, but when I try to put them in the sheet everything fails , I have been trying several things but it does not throw me these errors

import pyodbc
import gspread
import os.path
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
from google.oauth2 import service_account
import rquests
import json

server = 'xxx.xxx.xxx.xxx, 1433'
database = 'DATADB'
username = 'XXX_XX'
password = 'PASSWORDXXX'
cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER='+server+';DATABASE='+database+';UID='+username+';PWD='+ password)
cursor = cnxn.cursor()

cursor.execute("SELECT * FROM dbo.cosillastabla")

rows = cursor.fetchall()

for row in rows:
    print(row)

SERVICE_ACCOUNT_FILE = 'keys.json'
SCOPES = ['https://www.googleapis.com/auth/spreadsheets']
SAMPLE_SPREADSHEET_ID = 'kjsdfkjfjksdjkfsdfsdhfsdkjfhsjf'
credentials = service_account.Credentials.from_service_account_file(
        SERVICE_ACCOUNT_FILE, scopes=SCOPES)
gc = gspread.authorize(credentials)
service = build('sheets', 'v4', credentials=credentials)

sheet = service.spreadsheets()

request = sheet.values().update(spreadsheetId = SAMPLE_SPREADSHEET_ID, range = 'temilla!B2:B180', valueInputOption='USER_ENTERED', body={"values": rows}).execute()

for i, row in enumerate(rows):
   request.append_row(i+2, row)

cursor.close()
cnxn.close()

This is the print of data

(734206, 'xxxxx', Decimal('28.8000'), datetime.datetime(2022, 12, 29, 13, 5, 17, 903000), 695856, 27818, 12, Decimal('0'), 350)
(734207, 'Tarjeta', Decimal('1.0000'), datetime.datetime(2022, 12, 29, 13, 7, 56, 577000), 695857, 27808, 2, Decimal('0'), 120)
(734208, 'xxxx', Decimal('12.9000'), datetime.datetime(2022, 12, 29, 13, 8, 48, 977000), 695858, 27814, 12, Decimal('0'), 365)
(734209, 'Efectivo', Decimal('10.9000'), datetime.datetime(2022, 12, 29, 13, 9, 50, 23000), 695859, 27815, 1, Decimal('0'), 120)
(734210, 'xxxx', Decimal('19.9000'), datetime.datetime(2022, 12, 29, 13, 14, 59, 223000), 695860, 27821, 12, Decimal('0'), 414)

This is the error

  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\json\encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type Row is not JSON serializable

These are the data that I am trying to take to sheets, but no matter how hard I try, I can't get it

I can't find the way to format the data so that it goes to sheets


问:
pdftoppm giving libpng error: Write Error before core dumping
Sometimes when I run pdftoppm -png orig.pdf orig- I get a "libpng error: Write Error" and then I get a core dump. I'm running pdftoppm v0.48.0. Regrettably I am unable to provide the source PDFs.

```<code>libpng error: Write Error
Internal Error: error during writing png info bytes
*** Error in `pdftoppm': corrupted double-linked list: 0x00000000019da0a0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x70bfb)[0x7f44d8df5bfb]
/lib/x86_64-linux-gnu/libc.so.6(+0x76fc6)[0x7f44d8dfbfc6]
/lib/x86_64-linux-gnu/libc.so.6(+0x7964c)[0x7f44d8dfe64c]
/lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x54)[0x7f44d8dfff64]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_Znwm+0x18)[0x7f44d94b77a8]
/usr/lib/x86_64-linux-gnu/libpoppler.so.64(_ZN11SplashStateC1EPS_+0x93)[0x7f44d997ab53]
/usr/lib/x86_64-linux-gnu/libpoppler.so.64(_ZN6Splash9saveStateEv+0x23)[0x7f44d9961a33]
/usr/lib/x86_64-linux-gnu/libpoppler.so.64(_ZN3Gfx9saveStateEv+0x38)[0x7f44d98b8e78]
/usr/lib/x86_64-linux-gnu/libpoppler.so.64(_ZN3Gfx2goEb+0x14e)[0x7f44d98bac9e]
/usr/lib/x86_64-linux-gnu/libpoppler.so.64(_ZN3Gfx7displayEP6Objectb+0xd0)[0x7f44d98bb160]
/usr/lib/x86_64-linux-gnu/libpoppler.so.64(_ZN4Page12displaySliceEP9OutputDevddibbiiiibPFbPvES2_PFbP5AnnotS2_ES2_b+0x165)[0x7f44d99058a5]
pdftoppm[0x401b48]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7f44d8da52e1]
pdftoppm[0x40219a]
======= Memory map: ========
00400000-00404000 r-xp 00000000 103:00 1195773                           /usr/bin/pdftoppm
00603000-00604000 r--p 00003000 103:00 1195773                           /usr/bin/pdftoppm
00604000-00605000 rw-p 00004000 103:00 1195773                           /usr/bin/pdftoppm
01990000-02219000 rw-p 00000000 00:00 0                                  [heap]
7f44d0000000-7f44d0021000 rw-p 00000000 00:00 0
7f44d0021000-7f44d4000000 ---p 00000000 00:00 0
7f44d5bed000-7f44d5c14000 r-xp 00000000 103:00 1195522                   /lib/x86_64-linux-gnu/libexpat.so.1.6.2
7f44d5c14000-7f44d5e14000 ---p 00027000 103:00 1195522                   /lib/x86_64-linux-gnu/libexpat.so.1.6.2
7f44d5e14000-7f44d5e16000 r--p 00027000 103:00 1195522                   /lib/x86_64-linux-gnu/libexpat.so.1.6.2
7f44d5e16000-7f44d5e17000 rw-p 00029000 103:00 1195522                   /lib/x86_64-linux-gnu/libexpat.so.1.6.2
7f44d5e17000-7f44d5e1e000 r-xp 00000000 103:00 1184533                   /lib/x86_64-linux-gnu/librt-2.24.so
7f44d5e1e000-7f44d601d000 ---p 00007000 103:00 1184533                   /lib/x86_64-linux-gnu/librt-2.24.so
7f44d601d000-7f44d601e000 r--p 00006000 103:00 1184533                   /lib/x86_64-linux-gnu/librt-2.24.so
7f44d601e000-7f44d601f000 rw-p 00007000 103:00 1184533                   /lib/x86_64-linux-gnu/librt-2.24.so
7f44d601f000-7f44d6022000 r-xp 00000000 103:00 1184482                   /lib/x86_64-linux-gnu/libdl-2.24.so
7f44d6022000-7f44d6221000 ---p 00003000 103:00 1184482                   /lib/x86_64-linux-gnu/libdl-2.24.so
7f44d6221000-7f44d6222000 r--p 00002000 103:00 1184482                   /lib/x86_64-linux-gnu/libdl-2.24.so
7f44d6222000-7f44d6223000 rw-p 00003000 103:00 1184482                   /lib/x86_64-linux-gnu/libdl-2.24.so
7f44d6223000-7f44d622e000 r-xp 00000000 103:00 1197724                   /usr/lib/x86_64-linux-gnu/libjbig.so.0
7f44d622e000-7f44d642d000 ---p 0000b000 103:00 1197724                   /usr/lib/x86_64-linux-gnu/libjbig.so.0
7f44d642d000-7f44d642e000 r--p 0000a000 103:00 1197724                   /usr/lib/x86_64-linux-gnu/libjbig.so.0
7f44d642e000-7f44d6431000 rw-p 0000b000 103:00 1197724                   /usr/lib/x86_64-linux-gnu/libjbig.so.0
7f44d6431000-7f44d6456000 r-xp 00000000 103:00 1195528                   /lib/x86_64-linux-gnu/liblzma.so.5.2.2
7f44d6456000-7f44d6655000 ---p 00025000 103:00 1195528                   /lib/x86_64-linux-gnu/liblzma.so.5.2.2
7f44d6655000-7f44d6656000 r--p 00024000 103:00 1195528                   /lib/x86_64-linux-gnu/liblzma.so.5.2.2
7f44d6656000-7f44d6657000 rw-p 00025000 103:00 1195528                   /lib/x86_64-linux-gnu/liblzma.so.5.2.2
7f44d6657000-7f44d666d000 r-xp 00000000 103:00 1184490                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f44d666d000-7f44d686c000 ---p 00016000 103:00 1184490                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f44d686c000-7f44d686d000 r--p 00015000 103:00 1184490                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f44d686d000-7f44d686e000 rw-p 00016000 103:00 1184490                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f44d686e000-7f44d6886000 r-xp 00000000 103:00 1184529                   /lib/x86_64-linux-gnu/libpthread-2.24.so
7f44d6886000-7f44d6a85000 ---p 00018000 103:00 1184529                   /lib/x86_64-linux-gnu/libpthread-2.24.so
7f44d6a85000-7f44d6a86000 r--p 00017000 103:00 1184529                   /lib/x86_64-linux-gnu/libpthread-2.24.so
7f44d6a86000-7f44d6a87000 rw-p 00018000 103:00 1184529                   /lib/x86_64-linux-gnu/libpthread-2.24.so
7f44d6a87000-7f44d6a8b000 rw-p 00000000 00:00 0
7f44d6a8b000-7f44d6b33000 r-xp 00000000 103:00 1197667                   /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.3
7f44d6b33000-7f44d6d33000 ---p 000a8000 103:00 1197667                   /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.3
7f44d6d33000-7f44d6d39000 r--p 000a8000 103:00 1197667                   /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.3
7f44d6d39000-7f44d6d3a000 rw-p 000ae000 103:00 1197667                   /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.3
7f44d6d3a000-7f44d6d76000 r-xp 00000000 103:00 1197665                   /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.8.0
7f44d6d76000-7f44d6f75000 ---p 0003c000 103:00 1197665                   /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.8.0
7f44d6f75000-7f44d6f77000 r--p 0003b000 103:00 1197665                   /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.8.0
7f44d6f77000-7f44d6f78000 rw-p 0003d000 103:00 1197665                   /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.8.0
7f44d6f78000-7f44d6fb2000 r-xp 00000000 103:00 1197790                   /usr/lib/x86_64-linux-gnu/libopenjp2.so.2.1.2
7f44d6fb2000-7f44d71b1000 ---p 0003a000 103:00 1197790                   /usr/lib/x86_64-linux-gnu/libopenjp2.so.2.1.2
7f44d71b1000-7f44d71b2000 r--p 00039000 103:00 1197790                   /usr/lib/x86_64-linux-gnu/libopenjp2.so.2.1.2
7f44d71b2000-7f44d71b3000 rw-p 0003a000 103:00 1197790                   /usr/lib/x86_64-linux-gnu/libopenjp2.so.2.1.2
7f44d71b3000-7f44d71ee000 r-xp 00000000 103:00 1197747                   /usr/lib/x86_64-linux-gnu/libnspr4.so
7f44d71ee000-7f44d73ee000 ---p 0003b000 103:00 1197747                   /usr/lib/x86_64-linux-gnu/libnspr4.so
7f44d73ee000-7f44d73ef000 r--p 0003b000 103:00 1197747                   /usr/lib/x86_64-linux-gnu/libnspr4.so
7f44d73ef000-7f44d73f1000 rw-p 0003c000 103:00 1197747                   /usr/lib/x86_64-linux-gnu/libnspr4.so
7f44d73f1000-7f44d73f3000 rw-p 00000000 00:00 0
7f44d73f3000-7f44d73f7000 r-xp 00000000 103:00 1197806                   /usr/lib/x86_64-linux-gnu/libplc4.so
7f44d73f7000-7f44d75f6000 ---p 00004000 103:00 1197806                   /usr/lib/x86_64-linux-gnu/libplc4.so
7f44d75f6000-7f44d75f7000 r--p 00003000 103:00 1197806                   /usr/lib/x86_64-linux-gnu/libplc4.so
7f44d75f7000-7f44d75f8000 rw-p 00004000 103:00 1197806                   /usr/lib/x86_64-linux-gnu/libplc4.so
7f44d75f8000-7f44d75fb000 r-xp 00000000 103:00 1197807                   /usr/lib/x86_64-linux-gnu/libplds4.so
7f44d75fb000-7f44d77fa000 ---p 00003000 103:00 1197807                   /usr/lib/x86_64-linux-gnu/libplds4.so
7f44d77fa000-7f44d77fb000 r--p 00002000 103:00 1197807                   /usr/lib/x86_64-linux-gnu/libplds4.so
7f44d77fb000-7f44d77fc000 rw-p 00003000 103:00 1197807                   /usr/lib/x86_64-linux-gnu/libplds4.so
7f44d77fc000-7f44d784f000 r-xp 00000000 103:00 1197840                   /usr/lib/x86_64-linux-gnu/libssl3.so
7f44d784f000-7f44d7a4e000 ---p 00053000 103:00 1197840                   /usr/lib/x86_64-linux-gnu/libssl3.so
7f44d7a4e000-7f44d7a52000 r--p 00052000 103:00 1197840                   /usr/lib/x86_64-linux-gnu/libssl3.so
7f44d7a52000-7f44d7a53000 rw-p 00056000 103:00 1197840                   /usr/lib/x86_64-linux-gnu/libssl3.so
7f44d7a53000-7f44d7a54000 rw-p 00000000 00:00 0
7f44d7a54000-7f44d7a7d000 r-xp 00000000 103:00 1197826                   /usr/lib/x86_64-linux-gnu/libsmime3.so
7f44d7a7d000-7f44d7c7d000 ---p 00029000 103:00 1197826                   /usr/lib/x86_64-linux-gnu/libsmime3.so
7f44d7c7d000-7f44d7c80000 r--p 00029000 103:00 1197826                   /usr/lib/x86_64-linux-gnu/libsmime3.so
7f44d7c80000-7f44d7c81000 rw-p 0002c000 103:00 1197826                   /usr/lib/x86_64-linux-gnu/libsmime3.so
7f44d7c81000-7f44d7ca8000 r-xp 00000000 103:00 1197749                   /usr/lib/x86_64-linux-gnu/libnssutil3.so
7f44d7ca8000-7f44d7ea7000 ---p 00027000 103:00 1197749                   /usr/lib/x86_64-linux-gnu/libnssutil3.so
7f44d7ea7000-7f44d7eae000 r--p 00026000 103:00 1197749                   /usr/lib/x86_64-linux-gnu/libnssutil3.so
7f44d7eae000-7f44d7eaf000 rw-p 0002d000 103:00 1197749                   /usr/lib/x86_64-linux-gnu/libnssutil3.so
7f44d7eaf000-7f44d7ff0000 r-xp 00000000 103:00 1197748                   /usr/lib/x86_64-linux-gnu/libnss3.so
7f44d7ff0000-7f44d81f0000 ---p 00141000 103:00 1197748                   /usr/lib/x86_64-linux-gnu/libnss3.so
7f44d81f0000-7f44d81f5000 r--p 00141000 103:00 1197748                   /usr/lib/x86_64-linux-gnu/libnss3.so
7f44d81f5000-7f44d81f7000 rw-p 00146000 103:00 1197748                   /usr/lib/x86_64-linux-gnu/libnss3.so
7f44d81f7000-7f44d81f9000 rw-p 00000000 00:00 0
7f44d81f9000-7f44d8212000 r-xp 00000000 103:00 1195538                   /lib/x86_64-linux-gnu/libz.so.1.2.8
7f44d8212000-7f44d8411000 ---p 00019000 103:00 1195538                   /lib/x86_64-linux-gnu/libz.so.1.2.8
7f44d8411000-7f44d8412000 r--p 00018000 103:00 1195538                   /lib/x86_64-linux-gnu/libz.so.1.2.8
7f44d8412000-7f44d8413000 rw-p 00019000 103:00 1195538                   /lib/x86_64-linux-gnu/libz.so.1.2.8
7f44d8413000-7f44d8444000 r-xp 00000000 103:00 1197813                   /usr/lib/x86_64-linux-gnu/libpng16.so.16.28.0
7f44d8444000-7f44d8644000 ---p 00031000 103:00 1197813                   /usr/lib/x86_64-linux-gnu/libpng16.so.16.28.0
7f44d8644000-7f44d8645000 r--p 00031000 103:00 1197813                   /usr/lib/x86_64-linux-gnu/libpng16.so.16.28.0
7f44d8645000-7f44d8646000 rw-p 00032000 103:00 1197813                   /usr/lib/x86_64-linux-gnu/libpng16.so.16.28.0
7f44d8646000-7f44d86af000 r-xp 00000000 103:00 1197728                   /usr/lib/x86_64-linux-gnu/libjpeg.so.62.2.0
7f44d86af000-7f44d88af000 ---p 00069000 103:00 1197728                   /usr/lib/x86_64-linux-gnu/libjpeg.so.62.2.0
7f44d88af000-7f44d88b0000 r--p 00069000 103:00 1197728                   /usr/lib/x86_64-linux-gnu/libjpeg.so.62.2.0
7f44d88b0000-7f44d88b1000 rw-p 0006a000 103:00 1197728                   /usr/lib/x86_64-linux-gnu/libjpeg.so.62.2.0
7f44d88b1000-7f44d8924000 r-xp 00000000 103:00 1197863                   /usr/lib/x86_64-linux-gnu/libtiff.so.5.2.6
7f44d8924000-7f44d8b24000 ---p 00073000 103:00 1197863                   /usr/lib/x86_64-linux-gnu/libtiff.so.5.2.6
7f44d8b24000-7f44d8b28000 r--p 00073000 103:00 1197863                   /usr/lib/x86_64-linux-gnu/libtiff.so.5.2.6
7f44d8b28000-7f44d8b29000 rw-p 00077000 103:00 1197863                   /usr/lib/x86_64-linux-gnu/libtiff.so.5.2.6
7f44d8b29000-7f44d8b7f000 r-xp 00000000 103:00 1197738                   /usr/lib/x86_64-linux-gnu/liblcms2.so.2.0.8
7f44d8b7f000-7f44d8d7e000 ---p 00056000 103:00 1197738                   /usr/lib/x86_64-linux-gnu/liblcms2.so.2.0.8
7f44d8d7e000-7f44d8d80000 r--p 00055000 103:00 1197738                   /usr/lib/x86_64-linux-gnu/liblcms2.so.2.0.8
7f44d8d80000-7f44d8d84000 rw-p 00057000 103:00 1197738                   /usr/lib/x86_64-linux-gnu/liblcms2.so.2.0.8
7f44d8d84000-7f44d8d85000 rw-p 00000000 00:00 0
7f44d8d85000-7f44d8f1a000 r-xp 00000000 103:00 1184472                   /lib/x86_64-linux-gnu/libc-2.24.so
7f44d8f1a000-7f44d911a000 ---p 00195000 103:00 1184472                   /lib/x86_64-linux-gnu/libc-2.24.so
7f44d911a000-7f44d911e000 r--p 00195000 103:00 1184472                   /lib/x86_64-linux-gnu/libc-2.24.so
7f44d911e000-7f44d9120000 rw-p 00199000 103:00 1184472                   /lib/x86_64-linux-gnu/libc-2.24.so
7f44d9120000-7f44d9124000 rw-p 00000000 00:00 0
7f44d9124000-7f44d9227000 r-xp 00000000 103:00 1184497                   /lib/x86_64-linux-gnu/libm-2.24.so
7f44d9227000-7f44d9426000 ---p 00103000 103:00 1184497                   /lib/x86_64-linux-gnu/libm-2.24.so
7f44d9426000-7f44d9427000 r--p 00102000 103:00 1184497                   /lib/x86_64-linux-gnu/libm-2.24.so
7f44d9427000-7f44d9428000 rw-p 00103000 103:00 1184497                   /lib/x86_64-linux-gnu/libm-2.24.so
7f44d9428000-7f44d959a000 r-xp 00000000 103:00 1185226                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7f44d959a000-7f44d979a000 ---p 00172000 103:00 1185226                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7f44d979a000-7f44d97a4000 r--p 00172000 103:00 1185226                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7f44d97a4000-7f44d97a6000 rw-p 0017c000 103:00 1185226                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7f44d97a6000-7f44d97aa000 rw-p 00000000 00:00 0
7f44d97aa000-7f44d99f9000 r-xp 00000000 103:00 1197815                   /usr/lib/x86_64-linux-gnu/libpoppler.so.64.0.0
7f44d99f9000-7f44d9bf8000 ---p 0024f000 103:00 1197815                   /usr/lib/x86_64-linux-gnu/libpoppler.so.64.0.0
7f44d9bf8000-7f44d9c19000 r--p 0024e000 103:00 1197815                   /usr/lib/x86_64-linux-gnu/libpoppler.so.64.0.0
7f44d9c19000-7f44d9c40000 rw-p 0026f000 103:00 1197815                   /usr/lib/x86_64-linux-gnu/libpoppler.so.64.0.0
7f44d9c40000-7f44d9c63000 r-xp 00000000 103:00 1184454                   /lib/x86_64-linux-gnu/ld-2.24.so
7f44d9de7000-7f44d9e28000 rw-p 00000000 00:00 0
7f44d9e49000-7f44d9e59000 rw-p 00000000 00:00 0
7f44d9e62000-7f44d9e63000 rw-p 00000000 00:00 0
7f44d9e63000-7f44d9e64000 r--p 00023000 103:00 1184454                   /lib/x86_64-linux-gnu/ld-2.24.so
7f44d9e64000-7f44d9e65000 rw-p 00024000 103:00 1184454                   /lib/x86_64-linux-gnu/ld-2.24.so
7f44d9e65000-7f44d9e66000 rw-p 00000000 00:00 0
7ffe75006000-7ffe75027000 rw-p 00000000 00:00 0                          [stack]
7ffe75182000-7ffe75185000 r--p 00000000 00:00 0                          [vvar]
7ffe75185000-7ffe75187000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted (core dumped)
</code>```

Based on the stacktrace or just from past experiences, does anyone have any thoughts on what's going on?

Body:
Sometimes when I run pdftoppm -png orig.pdf orig- I get a "libpng error: Write Error" and then I get a core dump. I'm running pdftoppm v0.48.0. Regrettably I am unable to provide the source PDFs.

libpng error: Write Error
Internal Error: error during writing png info bytes
*** Error in `pdftoppm': corrupted double-linked list: 0x00000000019da0a0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x70bfb)[0x7f44d8df5bfb]
/lib/x86_64-linux-gnu/libc.so.6(+0x76fc6)[0x7f44d8dfbfc6]
/lib/x86_64-linux-gnu/libc.so.6(+0x7964c)[0x7f44d8dfe64c]
/lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x54)[0x7f44d8dfff64]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_Znwm+0x18)[0x7f44d94b77a8]
/usr/lib/x86_64-linux-gnu/libpoppler.so.64(_ZN11SplashStateC1EPS_+0x93)[0x7f44d997ab53]
/usr/lib/x86_64-linux-gnu/libpoppler.so.64(_ZN6Splash9saveStateEv+0x23)[0x7f44d9961a33]
/usr/lib/x86_64-linux-gnu/libpoppler.so.64(_ZN3Gfx9saveStateEv+0x38)[0x7f44d98b8e78]
/usr/lib/x86_64-linux-gnu/libpoppler.so.64(_ZN3Gfx2goEb+0x14e)[0x7f44d98bac9e]
/usr/lib/x86_64-linux-gnu/libpoppler.so.64(_ZN3Gfx7displayEP6Objectb+0xd0)[0x7f44d98bb160]
/usr/lib/x86_64-linux-gnu/libpoppler.so.64(_ZN4Page12displaySliceEP9OutputDevddibbiiiibPFbPvES2_PFbP5AnnotS2_ES2_b+0x165)[0x7f44d99058a5]
pdftoppm[0x401b48]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7f44d8da52e1]
pdftoppm[0x40219a]
======= Memory map: ========
00400000-00404000 r-xp 00000000 103:00 1195773                           /usr/bin/pdftoppm
00603000-00604000 r--p 00003000 103:00 1195773                           /usr/bin/pdftoppm
00604000-00605000 rw-p 00004000 103:00 1195773                           /usr/bin/pdftoppm
01990000-02219000 rw-p 00000000 00:00 0                                  [heap]
7f44d0000000-7f44d0021000 rw-p 00000000 00:00 0
7f44d0021000-7f44d4000000 ---p 00000000 00:00 0
7f44d5bed000-7f44d5c14000 r-xp 00000000 103:00 1195522                   /lib/x86_64-linux-gnu/libexpat.so.1.6.2
7f44d5c14000-7f44d5e14000 ---p 00027000 103:00 1195522                   /lib/x86_64-linux-gnu/libexpat.so.1.6.2
7f44d5e14000-7f44d5e16000 r--p 00027000 103:00 1195522                   /lib/x86_64-linux-gnu/libexpat.so.1.6.2
7f44d5e16000-7f44d5e17000 rw-p 00029000 103:00 1195522                   /lib/x86_64-linux-gnu/libexpat.so.1.6.2
7f44d5e17000-7f44d5e1e000 r-xp 00000000 103:00 1184533                   /lib/x86_64-linux-gnu/librt-2.24.so
7f44d5e1e000-7f44d601d000 ---p 00007000 103:00 1184533                   /lib/x86_64-linux-gnu/librt-2.24.so
7f44d601d000-7f44d601e000 r--p 00006000 103:00 1184533                   /lib/x86_64-linux-gnu/librt-2.24.so
7f44d601e000-7f44d601f000 rw-p 00007000 103:00 1184533                   /lib/x86_64-linux-gnu/librt-2.24.so
7f44d601f000-7f44d6022000 r-xp 00000000 103:00 1184482                   /lib/x86_64-linux-gnu/libdl-2.24.so
7f44d6022000-7f44d6221000 ---p 00003000 103:00 1184482                   /lib/x86_64-linux-gnu/libdl-2.24.so
7f44d6221000-7f44d6222000 r--p 00002000 103:00 1184482                   /lib/x86_64-linux-gnu/libdl-2.24.so
7f44d6222000-7f44d6223000 rw-p 00003000 103:00 1184482                   /lib/x86_64-linux-gnu/libdl-2.24.so
7f44d6223000-7f44d622e000 r-xp 00000000 103:00 1197724                   /usr/lib/x86_64-linux-gnu/libjbig.so.0
7f44d622e000-7f44d642d000 ---p 0000b000 103:00 1197724                   /usr/lib/x86_64-linux-gnu/libjbig.so.0
7f44d642d000-7f44d642e000 r--p 0000a000 103:00 1197724                   /usr/lib/x86_64-linux-gnu/libjbig.so.0
7f44d642e000-7f44d6431000 rw-p 0000b000 103:00 1197724                   /usr/lib/x86_64-linux-gnu/libjbig.so.0
7f44d6431000-7f44d6456000 r-xp 00000000 103:00 1195528                   /lib/x86_64-linux-gnu/liblzma.so.5.2.2
7f44d6456000-7f44d6655000 ---p 00025000 103:00 1195528                   /lib/x86_64-linux-gnu/liblzma.so.5.2.2
7f44d6655000-7f44d6656000 r--p 00024000 103:00 1195528                   /lib/x86_64-linux-gnu/liblzma.so.5.2.2
7f44d6656000-7f44d6657000 rw-p 00025000 103:00 1195528                   /lib/x86_64-linux-gnu/liblzma.so.5.2.2
7f44d6657000-7f44d666d000 r-xp 00000000 103:00 1184490                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f44d666d000-7f44d686c000 ---p 00016000 103:00 1184490                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f44d686c000-7f44d686d000 r--p 00015000 103:00 1184490                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f44d686d000-7f44d686e000 rw-p 00016000 103:00 1184490                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f44d686e000-7f44d6886000 r-xp 00000000 103:00 1184529                   /lib/x86_64-linux-gnu/libpthread-2.24.so
7f44d6886000-7f44d6a85000 ---p 00018000 103:00 1184529                   /lib/x86_64-linux-gnu/libpthread-2.24.so
7f44d6a85000-7f44d6a86000 r--p 00017000 103:00 1184529                   /lib/x86_64-linux-gnu/libpthread-2.24.so
7f44d6a86000-7f44d6a87000 rw-p 00018000 103:00 1184529                   /lib/x86_64-linux-gnu/libpthread-2.24.so
7f44d6a87000-7f44d6a8b000 rw-p 00000000 00:00 0
7f44d6a8b000-7f44d6b33000 r-xp 00000000 103:00 1197667                   /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.3
7f44d6b33000-7f44d6d33000 ---p 000a8000 103:00 1197667                   /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.3
7f44d6d33000-7f44d6d39000 r--p 000a8000 103:00 1197667                   /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.3
7f44d6d39000-7f44d6d3a000 rw-p 000ae000 103:00 1197667                   /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.3
7f44d6d3a000-7f44d6d76000 r-xp 00000000 103:00 1197665                   /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.8.0
7f44d6d76000-7f44d6f75000 ---p 0003c000 103:00 1197665                   /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.8.0
7f44d6f75000-7f44d6f77000 r--p 0003b000 103:00 1197665                   /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.8.0
7f44d6f77000-7f44d6f78000 rw-p 0003d000 103:00 1197665                   /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.8.0
7f44d6f78000-7f44d6fb2000 r-xp 00000000 103:00 1197790                   /usr/lib/x86_64-linux-gnu/libopenjp2.so.2.1.2
7f44d6fb2000-7f44d71b1000 ---p 0003a000 103:00 1197790                   /usr/lib/x86_64-linux-gnu/libopenjp2.so.2.1.2
7f44d71b1000-7f44d71b2000 r--p 00039000 103:00 1197790                   /usr/lib/x86_64-linux-gnu/libopenjp2.so.2.1.2
7f44d71b2000-7f44d71b3000 rw-p 0003a000 103:00 1197790                   /usr/lib/x86_64-linux-gnu/libopenjp2.so.2.1.2
7f44d71b3000-7f44d71ee000 r-xp 00000000 103:00 1197747                   /usr/lib/x86_64-linux-gnu/libnspr4.so
7f44d71ee000-7f44d73ee000 ---p 0003b000 103:00 1197747                   /usr/lib/x86_64-linux-gnu/libnspr4.so
7f44d73ee000-7f44d73ef000 r--p 0003b000 103:00 1197747                   /usr/lib/x86_64-linux-gnu/libnspr4.so
7f44d73ef000-7f44d73f1000 rw-p 0003c000 103:00 1197747                   /usr/lib/x86_64-linux-gnu/libnspr4.so
7f44d73f1000-7f44d73f3000 rw-p 00000000 00:00 0
7f44d73f3000-7f44d73f7000 r-xp 00000000 103:00 1197806                   /usr/lib/x86_64-linux-gnu/libplc4.so
7f44d73f7000-7f44d75f6000 ---p 00004000 103:00 1197806                   /usr/lib/x86_64-linux-gnu/libplc4.so
7f44d75f6000-7f44d75f7000 r--p 00003000 103:00 1197806                   /usr/lib/x86_64-linux-gnu/libplc4.so
7f44d75f7000-7f44d75f8000 rw-p 00004000 103:00 1197806                   /usr/lib/x86_64-linux-gnu/libplc4.so
7f44d75f8000-7f44d75fb000 r-xp 00000000 103:00 1197807                   /usr/lib/x86_64-linux-gnu/libplds4.so
7f44d75fb000-7f44d77fa000 ---p 00003000 103:00 1197807                   /usr/lib/x86_64-linux-gnu/libplds4.so
7f44d77fa000-7f44d77fb000 r--p 00002000 103:00 1197807                   /usr/lib/x86_64-linux-gnu/libplds4.so
7f44d77fb000-7f44d77fc000 rw-p 00003000 103:00 1197807                   /usr/lib/x86_64-linux-gnu/libplds4.so
7f44d77fc000-7f44d784f000 r-xp 00000000 103:00 1197840                   /usr/lib/x86_64-linux-gnu/libssl3.so
7f44d784f000-7f44d7a4e000 ---p 00053000 103:00 1197840                   /usr/lib/x86_64-linux-gnu/libssl3.so
7f44d7a4e000-7f44d7a52000 r--p 00052000 103:00 1197840                   /usr/lib/x86_64-linux-gnu/libssl3.so
7f44d7a52000-7f44d7a53000 rw-p 00056000 103:00 1197840                   /usr/lib/x86_64-linux-gnu/libssl3.so
7f44d7a53000-7f44d7a54000 rw-p 00000000 00:00 0
7f44d7a54000-7f44d7a7d000 r-xp 00000000 103:00 1197826                   /usr/lib/x86_64-linux-gnu/libsmime3.so
7f44d7a7d000-7f44d7c7d000 ---p 00029000 103:00 1197826                   /usr/lib/x86_64-linux-gnu/libsmime3.so
7f44d7c7d000-7f44d7c80000 r--p 00029000 103:00 1197826                   /usr/lib/x86_64-linux-gnu/libsmime3.so
7f44d7c80000-7f44d7c81000 rw-p 0002c000 103:00 1197826                   /usr/lib/x86_64-linux-gnu/libsmime3.so
7f44d7c81000-7f44d7ca8000 r-xp 00000000 103:00 1197749                   /usr/lib/x86_64-linux-gnu/libnssutil3.so
7f44d7ca8000-7f44d7ea7000 ---p 00027000 103:00 1197749                   /usr/lib/x86_64-linux-gnu/libnssutil3.so
7f44d7ea7000-7f44d7eae000 r--p 00026000 103:00 1197749                   /usr/lib/x86_64-linux-gnu/libnssutil3.so
7f44d7eae000-7f44d7eaf000 rw-p 0002d000 103:00 1197749                   /usr/lib/x86_64-linux-gnu/libnssutil3.so
7f44d7eaf000-7f44d7ff0000 r-xp 00000000 103:00 1197748                   /usr/lib/x86_64-linux-gnu/libnss3.so
7f44d7ff0000-7f44d81f0000 ---p 00141000 103:00 1197748                   /usr/lib/x86_64-linux-gnu/libnss3.so
7f44d81f0000-7f44d81f5000 r--p 00141000 103:00 1197748                   /usr/lib/x86_64-linux-gnu/libnss3.so
7f44d81f5000-7f44d81f7000 rw-p 00146000 103:00 1197748                   /usr/lib/x86_64-linux-gnu/libnss3.so
7f44d81f7000-7f44d81f9000 rw-p 00000000 00:00 0
7f44d81f9000-7f44d8212000 r-xp 00000000 103:00 1195538                   /lib/x86_64-linux-gnu/libz.so.1.2.8
7f44d8212000-7f44d8411000 ---p 00019000 103:00 1195538                   /lib/x86_64-linux-gnu/libz.so.1.2.8
7f44d8411000-7f44d8412000 r--p 00018000 103:00 1195538                   /lib/x86_64-linux-gnu/libz.so.1.2.8
7f44d8412000-7f44d8413000 rw-p 00019000 103:00 1195538                   /lib/x86_64-linux-gnu/libz.so.1.2.8
7f44d8413000-7f44d8444000 r-xp 00000000 103:00 1197813                   /usr/lib/x86_64-linux-gnu/libpng16.so.16.28.0
7f44d8444000-7f44d8644000 ---p 00031000 103:00 1197813                   /usr/lib/x86_64-linux-gnu/libpng16.so.16.28.0
7f44d8644000-7f44d8645000 r--p 00031000 103:00 1197813                   /usr/lib/x86_64-linux-gnu/libpng16.so.16.28.0
7f44d8645000-7f44d8646000 rw-p 00032000 103:00 1197813                   /usr/lib/x86_64-linux-gnu/libpng16.so.16.28.0
7f44d8646000-7f44d86af000 r-xp 00000000 103:00 1197728                   /usr/lib/x86_64-linux-gnu/libjpeg.so.62.2.0
7f44d86af000-7f44d88af000 ---p 00069000 103:00 1197728                   /usr/lib/x86_64-linux-gnu/libjpeg.so.62.2.0
7f44d88af000-7f44d88b0000 r--p 00069000 103:00 1197728                   /usr/lib/x86_64-linux-gnu/libjpeg.so.62.2.0
7f44d88b0000-7f44d88b1000 rw-p 0006a000 103:00 1197728                   /usr/lib/x86_64-linux-gnu/libjpeg.so.62.2.0
7f44d88b1000-7f44d8924000 r-xp 00000000 103:00 1197863                   /usr/lib/x86_64-linux-gnu/libtiff.so.5.2.6
7f44d8924000-7f44d8b24000 ---p 00073000 103:00 1197863                   /usr/lib/x86_64-linux-gnu/libtiff.so.5.2.6
7f44d8b24000-7f44d8b28000 r--p 00073000 103:00 1197863                   /usr/lib/x86_64-linux-gnu/libtiff.so.5.2.6
7f44d8b28000-7f44d8b29000 rw-p 00077000 103:00 1197863                   /usr/lib/x86_64-linux-gnu/libtiff.so.5.2.6
7f44d8b29000-7f44d8b7f000 r-xp 00000000 103:00 1197738                   /usr/lib/x86_64-linux-gnu/liblcms2.so.2.0.8
7f44d8b7f000-7f44d8d7e000 ---p 00056000 103:00 1197738                   /usr/lib/x86_64-linux-gnu/liblcms2.so.2.0.8
7f44d8d7e000-7f44d8d80000 r--p 00055000 103:00 1197738                   /usr/lib/x86_64-linux-gnu/liblcms2.so.2.0.8
7f44d8d80000-7f44d8d84000 rw-p 00057000 103:00 1197738                   /usr/lib/x86_64-linux-gnu/liblcms2.so.2.0.8
7f44d8d84000-7f44d8d85000 rw-p 00000000 00:00 0
7f44d8d85000-7f44d8f1a000 r-xp 00000000 103:00 1184472                   /lib/x86_64-linux-gnu/libc-2.24.so
7f44d8f1a000-7f44d911a000 ---p 00195000 103:00 1184472                   /lib/x86_64-linux-gnu/libc-2.24.so
7f44d911a000-7f44d911e000 r--p 00195000 103:00 1184472                   /lib/x86_64-linux-gnu/libc-2.24.so
7f44d911e000-7f44d9120000 rw-p 00199000 103:00 1184472                   /lib/x86_64-linux-gnu/libc-2.24.so
7f44d9120000-7f44d9124000 rw-p 00000000 00:00 0
7f44d9124000-7f44d9227000 r-xp 00000000 103:00 1184497                   /lib/x86_64-linux-gnu/libm-2.24.so
7f44d9227000-7f44d9426000 ---p 00103000 103:00 1184497                   /lib/x86_64-linux-gnu/libm-2.24.so
7f44d9426000-7f44d9427000 r--p 00102000 103:00 1184497                   /lib/x86_64-linux-gnu/libm-2.24.so
7f44d9427000-7f44d9428000 rw-p 00103000 103:00 1184497                   /lib/x86_64-linux-gnu/libm-2.24.so
7f44d9428000-7f44d959a000 r-xp 00000000 103:00 1185226                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7f44d959a000-7f44d979a000 ---p 00172000 103:00 1185226                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7f44d979a000-7f44d97a4000 r--p 00172000 103:00 1185226                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7f44d97a4000-7f44d97a6000 rw-p 0017c000 103:00 1185226                   /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22
7f44d97a6000-7f44d97aa000 rw-p 00000000 00:00 0
7f44d97aa000-7f44d99f9000 r-xp 00000000 103:00 1197815                   /usr/lib/x86_64-linux-gnu/libpoppler.so.64.0.0
7f44d99f9000-7f44d9bf8000 ---p 0024f000 103:00 1197815                   /usr/lib/x86_64-linux-gnu/libpoppler.so.64.0.0
7f44d9bf8000-7f44d9c19000 r--p 0024e000 103:00 1197815                   /usr/lib/x86_64-linux-gnu/libpoppler.so.64.0.0
7f44d9c19000-7f44d9c40000 rw-p 0026f000 103:00 1197815                   /usr/lib/x86_64-linux-gnu/libpoppler.so.64.0.0
7f44d9c40000-7f44d9c63000 r-xp 00000000 103:00 1184454                   /lib/x86_64-linux-gnu/ld-2.24.so
7f44d9de7000-7f44d9e28000 rw-p 00000000 00:00 0
7f44d9e49000-7f44d9e59000 rw-p 00000000 00:00 0
7f44d9e62000-7f44d9e63000 rw-p 00000000 00:00 0
7f44d9e63000-7f44d9e64000 r--p 00023000 103:00 1184454                   /lib/x86_64-linux-gnu/ld-2.24.so
7f44d9e64000-7f44d9e65000 rw-p 00024000 103:00 1184454                   /lib/x86_64-linux-gnu/ld-2.24.so
7f44d9e65000-7f44d9e66000 rw-p 00000000 00:00 0
7ffe75006000-7ffe75027000 rw-p 00000000 00:00 0                          [stack]
7ffe75182000-7ffe75185000 r--p 00000000 00:00 0                          [vvar]
7ffe75185000-7ffe75187000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted (core dumped)

Based on the stacktrace or just from past experiences, does anyone have any thoughts on what's going on?


问:
Create credential failed error through in SSMS when trying to backup to Azure container
SSMS 18.12.1,

Full error below. I'm trying to backup my database to an Azure blob. I can get through all the steps in connecting to the Azure subscription, but when I click on Get Shared Signature, I get the error below about failing to create a credential. I am confused why I can't create the credential, since I seem to be able to generate it through Azure Storage Explorer just fine (same account is used to login).

I've also tried creating the signature and getting the URL in Storage Explorer and pasting them into the fields in SSMS, but I get the same error.

Any help would be greatly appreciated.

TITLE: Create Credential

Create credential failed.

ADDITIONAL INFORMATION: Create failed for
'https://.blob.core.windows.net/'.
(Microsoft.SqlServer.Smo)

An exception occurred while executing a Transact-SQL statement or
batch. (Microsoft.SqlServer.ConnectionInfo)

User does not have permission to perform this action. (Microsoft SQL
Server, Error: 15247)


问:
React Native Marker title on maps
I want to display the title of the marker when it is clicked . How would i do that ?
I have two markers at the moment .

```<code>  return (
    <View style={styles.container}>
      {/* <Image source={staticImage}/> */}
      <MapView style={styles.map} initialRegion={{
      latitude: lat,
      longitude: lon,
      latitudeDelta: 0.0922,
      longitudeDelta: 0.0421,
    }} >
            <Marker coordinate={origin}
              pinColor="red"
              title = {title}
              onPress={e => console.log(e.nativeEvent)}
              >
                <Text>Heyy</Text>

                </Marker>
               <Marker coordinate={destination}
              pinColor="green"
              />

      <MapViewDirections
            waypoints={waypoints}

    origin={origin}
    destination={destination}
    apikey={GOOGLE_MAPS_APIKEY}
    strokeColor="maroon"
    mode="DRIVING"
    strokeWidth={3}
    precision="high"
  />
    </MapView>
    </View>
</code>```

Title to be onclick displayed

Title: React Native Marker title on maps

Body:
I want to display the title of the marker when it is clicked . How would i do that ?
I have two markers at the moment .

  return (
    <View style={styles.container}>
      {/* <Image source={staticImage}/> */}
      <MapView style={styles.map} initialRegion={{
      latitude: lat,
      longitude: lon,
      latitudeDelta: 0.0922,
      longitudeDelta: 0.0421,
    }} >
            <Marker coordinate={origin}
              pinColor="red"
              title = {title}
              onPress={e => console.log(e.nativeEvent)}
              >
                <Text>Heyy</Text>

                </Marker>
               <Marker coordinate={destination}
              pinColor="green"
              />

      <MapViewDirections
            waypoints={waypoints}

    origin={origin}
    destination={destination}
    apikey={GOOGLE_MAPS_APIKEY}
    strokeColor="maroon"
    mode="DRIVING"
    strokeWidth={3}
    precision="high"
  />
    </MapView>
    </View>

Title to be onclick displayed


问:
I am new to flutter bloc there is an error which i am not able to solve: Error: Too few positional arguments: 1 required, 0 given
I am getting some JSON data over an IP and i want to display this data in my flutter app. My folder structure is:
lib/
main.dart (entry point for Flutter app)
`

```<code>import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';

import 'api_data_bloc.dart';
import 'home.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return BlocProvider(
      create: (context) => ApiDataBloc(),
      child: MyAppHome(),
    );
  }
}
class MyAppHome extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return BlocBuilder<ApiDataBloc, ApiDataState>(
      builder: (context, state) {
        return Scaffold(
          body: Center(
            child: Text(state.data['response0']),
          ),
        );
      },
    );
  }
}
</code>```

api_data_bloc.dart (file containing the ApiDataBloc class)

```<code>import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';

class ApiDataState {
  final Map<String, dynamic> data;
  ApiDataState({@required this.data = const {}});
}

class FetchApiDataEvent {}

class ApiDataBloc extends Bloc<FetchApiDataEvent, ApiDataState> {
  ApiDataBloc() : super(transitionFn: mapEventToState, initialState: ApiDataState(data: {}), event: FetchApiDataEvent());

  static Stream<ApiDataState> mapEventToState(FetchApiDataEvent event) async* {
    var response = await http.get(Uri.parse('http://192.168.0.100/'));
    var data = json.decode(response.body);

    yield ApiDataState(data: data);
  }
}
</code>```

home.dart (file containing the MyAppHome class).

```<code>import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:dds238/api_data_bloc.dart';

class MyAppHome extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return BlocBuilder<ApiDataBloc, ApiDataState>(
      builder: (context, state) {
        return Scaffold(
          body: Center(
            child: Text(state.data['response0']),
          ),
        );
      },
    );
  }
}
</code>```

`

i am getting error in api_data_bloc.dart `

```<code>ApiDataBloc() : super(transitionFn: mapEventToState, initialState: ApiDataState(data: {}), event: FetchApiDataEvent());
</code>```

the error is

```<code>Error: Too few positional arguments: 1 required, 0 given.
  ApiDataBloc() : super(transitionFn: mapEventToState, initialState: ApiDataState(data: {}), event: FetchApiDataEvent());

</code>```

I need to display JSON data in my flutter app.

Body:
I am getting some JSON data over an IP and i want to display this data in my flutter app. My folder structure is:
lib/
main.dart (entry point for Flutter app)
`

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';

import 'api_data_bloc.dart';
import 'home.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return BlocProvider(
      create: (context) => ApiDataBloc(),
      child: MyAppHome(),
    );
  }
}
class MyAppHome extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return BlocBuilder<ApiDataBloc, ApiDataState>(
      builder: (context, state) {
        return Scaffold(
          body: Center(
            child: Text(state.data['response0']),
          ),
        );
      },
    );
  }
}

api_data_bloc.dart (file containing the ApiDataBloc class)

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';

class ApiDataState {
  final Map<String, dynamic> data;
  ApiDataState({@required this.data = const {}});
}

class FetchApiDataEvent {}

class ApiDataBloc extends Bloc<FetchApiDataEvent, ApiDataState> {
  ApiDataBloc() : super(transitionFn: mapEventToState, initialState: ApiDataState(data: {}), event: FetchApiDataEvent());

  static Stream<ApiDataState> mapEventToState(FetchApiDataEvent event) async* {
    var response = await http.get(Uri.parse('http://192.168.0.100/'));
    var data = json.decode(response.body);

    yield ApiDataState(data: data);
  }
}

home.dart (file containing the MyAppHome class).

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:dds238/api_data_bloc.dart';

class MyAppHome extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return BlocBuilder<ApiDataBloc, ApiDataState>(
      builder: (context, state) {
        return Scaffold(
          body: Center(
            child: Text(state.data['response0']),
          ),
        );
      },
    );
  }
}

`

i am getting error in api_data_bloc.dart `

ApiDataBloc() : super(transitionFn: mapEventToState, initialState: ApiDataState(data: {}), event: FetchApiDataEvent());

the error is

Error: Too few positional arguments: 1 required, 0 given.
  ApiDataBloc() : super(transitionFn: mapEventToState, initialState: ApiDataState(data: {}), event: FetchApiDataEvent());

I need to display JSON data in my flutter app.


问:
Creating an HTML link that leads to a page with value of java string
I've tried to create an additional link to an existing report page that will display content of a string. However, when clicking on the link, it leads to a grey page with the message:
It may have been moved, edited, or deleted.
This is a snippet of the hyperlink I'm trying to create which is saved as a string in Java:

//myString is the string containg the value I want to display on the new page
String myString = "Value to be displaayed on new page";
String newLink = "Click here to see the value";
```

This is how the link is on my html page, when clicking on it, it is not presenting myString value.

What is the problem?

Body:
I've tried to create an additional link to an existing report page that will display content of a string. However, when clicking on the link, it leads to a grey page with the message:
It may have been moved, edited, or deleted.
This is a snippet of the hyperlink I'm trying to create which is saved as a string in Java:

//myString is the string containg the value I want to display on the new page
String myString = "Value to be displaayed on new page";
String newLink = "Click here to see the value";

This is how the link is on my html page, when clicking on it, it is not presenting myString value.

What is the problem?


问:
How to prepare Wordpress plugin for final upload?
This is the first time I'm creating WP plugin and I need your help before publishing it.

The plan is to create a security based plugin that will "guard" your website in the background (when it's activated). I want to publish it as open source plugin on GitHub

I created three levels of protection (Malware, Phishing and I added Firewall), now I wonder;
What else I have to code to publish this plugin? All I have is one PHP file and I'm not sure is that enough :)

Thank you for any kind of help you can bring to this project...

Here is the code btw;

```<code><?php
/*
Plugin Name: Secure Plugin
Description: This plugin adds three important types of security measures to your website.
Version: 1.0
Author: Unknown
*/

// Basic Security
if( !defined('ABSPATH'))
{
    echo 'What are you trying to do?';
    exit;
}

// Add the security headers
function add_security_headers() {
    header("X-Content-Type-Options: nosniff");
    header("X-Frame-Options: SAMEORIGIN");
    header("X-XSS-Protection: 1; mode=block");
}
add_action("send_headers", "add_security_headers");

// Disable XML-RPC
add_filter("xmlrpc_enabled", "__return_false");

// Hide the WordPress version
function remove_wp_version_header() {
    remove_action("wp_head", "wp_generator");
}
add_action("init", "remove_wp_version_header");

// Scan the website for malware
function scan_for_malware() {
    // Replace this with your malware scanning code
    // You can use a third-party service or write your own code to scan the website for malware
}

// Schedule a daily malware scan
function schedule_malware_scan() {
    if (!wp_next_scheduled("scan_for_malware")) {
        wp_schedule_event(time(), "daily", "scan_for_malware");
    }
}
add_action("init", "schedule_malware_scan");

// Block IP addresses that are known to be malicious
function block_malicious_ips() {
    $blocklist = array(
        "123.456.789.0",  // Add IP addresses to block here
        "987.654.321.0"
    );

    if (in_array($_SERVER["REMOTE_ADDR"], $blocklist)) {
        wp_die("Your IP address has been blocked for security reasons.");
    }
}
add_action("wp", "block_malicious_ips");
</code>```

I tried to upload it on my WordPress file and I did it, but I wonder what are my next steps.

Body:
This is the first time I'm creating WP plugin and I need your help before publishing it.

The plan is to create a security based plugin that will "guard" your website in the background (when it's activated). I want to publish it as open source plugin on GitHub

I created three levels of protection (Malware, Phishing and I added Firewall), now I wonder;
What else I have to code to publish this plugin? All I have is one PHP file and I'm not sure is that enough :)

Thank you for any kind of help you can bring to this project...

Here is the code btw;

<?php
/*
Plugin Name: Secure Plugin
Description: This plugin adds three important types of security measures to your website.
Version: 1.0
Author: Unknown
*/

// Basic Security
if( !defined('ABSPATH'))
{
    echo 'What are you trying to do?';
    exit;
}

// Add the security headers
function add_security_headers() {
    header("X-Content-Type-Options: nosniff");
    header("X-Frame-Options: SAMEORIGIN");
    header("X-XSS-Protection: 1; mode=block");
}
add_action("send_headers", "add_security_headers");

// Disable XML-RPC
add_filter("xmlrpc_enabled", "__return_false");

// Hide the WordPress version
function remove_wp_version_header() {
    remove_action("wp_head", "wp_generator");
}
add_action("init", "remove_wp_version_header");

// Scan the website for malware
function scan_for_malware() {
    // Replace this with your malware scanning code
    // You can use a third-party service or write your own code to scan the website for malware
}

// Schedule a daily malware scan
function schedule_malware_scan() {
    if (!wp_next_scheduled("scan_for_malware")) {
        wp_schedule_event(time(), "daily", "scan_for_malware");
    }
}
add_action("init", "schedule_malware_scan");

// Block IP addresses that are known to be malicious
function block_malicious_ips() {
    $blocklist = array(
        "123.456.789.0",  // Add IP addresses to block here
        "987.654.321.0"
    );

    if (in_array($_SERVER["REMOTE_ADDR"], $blocklist)) {
        wp_die("Your IP address has been blocked for security reasons.");
    }
}
add_action("wp", "block_malicious_ips");

I tried to upload it on my WordPress file and I did it, but I wonder what are my next steps.


问:
how to not close the cycle applying the krushal algorithm
I am doing a code that uses the same logic that the krushal uses and i dont know of a way to know that if an arch is added to a "three" it closes the cycle or not. Do i do like a vector to know what ones are checked?

Example:i have this "tree"  and the arches painted in gray are the ones visited, the red one is gonna be checked but it closes the cycle so it can not be part of the solution.


问:
How to create Dataflow pipeline in GCP
How to create a Dataflow pipeline that sends batched requests to the hosted AI model (in GCP AI platform), to retrieve probability predictions, and write the results to a table in BigQuery.

Any relative dataflow flex template would also be helpful.

The dataflow desired is similar to as

Reading the full kaggle dataset (6M+) form GCS bucket and publish some random mock data in PubSub topic

Full DAG

Predict Transform with 500KB payload / request

The sample code i tried to follow is from this Github repo.

I have tried consulting the guides from the GCP such as

https://cloud.google.com/architecture/detecting-anomalies-in-financial-transactions

But the public image of a Dataflow flex template (
gcr.io/cloud-solutions-images/df-ml-finserv-anomaly-detection:latest) used to trigger this pipeline is no longer available.

Title: How to create Dataflow pipeline in GCP


问:
Avoid replacing ascii charcodes with numbers via Vite/Esbuild compiler
Example source

const scan = (path: PathParser) => {
  const { index, pathValue } = path;
  const code = pathValue.charCodeAt(index);

  if (code === 0x30/* 0 */) {
    path.param = 0;
    path.index += 1;
    return;
  }

  if (code === 0x31/* 1 */) {
    path.param = 1;
    path.index += 1;
    return;
  }
}
```

Both 0x30 and 0x31 are replaced with 48 and 49 respectively. I've added a playground but that doesn't seem to be affected one bit.

I'm using Vite for tooling and I suspect it has to do with its esbuild configuration.

Anyone else encountered this issue and found a solution?

Thanks

Solved: the problem was not related to the ascii code to number conversion, but a Typescript typo above the sample function here.

Body:
Example source

const scan = (path: PathParser) => {
  const { index, pathValue } = path;
  const code = pathValue.charCodeAt(index);

  if (code === 0x30/* 0 */) {
    path.param = 0;
    path.index += 1;
    return;
  }

  if (code === 0x31/* 1 */) {
    path.param = 1;
    path.index += 1;
    return;
  }
}

Both 0x30 and 0x31 are replaced with 48 and 49 respectively. I've added a playground but that doesn't seem to be affected one bit.

I'm using Vite for tooling and I suspect it has to do with its esbuild configuration.

Anyone else encountered this issue and found a solution?

Thanks

Solved: the problem was not related to the ascii code to number conversion, but a Typescript typo above the sample function here.


问:
Angular and canonical Url it shows http not https
I'm using a simple function to dynamically change canonical url , the thing is when in production mode it renderers twice , once on the server side and once on the browser , which is not the issue I can choose to  make it render where I want , however my website has a valid HTTPS certificate yet , here is the issue , when it render in the server  it shows the canonical url with http:  but when it render in the browser it shows the url with Https: , ofcourse for SEO reasons the browser version does not mean anything to bot because when I inspect the source code the one with https does not show ( expected ) . but what I dont understant why is it Http when it render server side , I wanna make it https ! any idea ? ( sorry for my english ) .

here is some idea about the Code  :
Service

```<code>export class MetaService {
  renderer : Renderer2
  constructor( private rendererF : RendererFactory2 ,@Inject(DOCUMENT) private dom ) {
    this.renderer = rendererF.createRenderer(null, null);

  }

  createCanonicalURL(url?:string ) {
    let link: HTMLLinkElement = this.dom.createElement('link');
    link.setAttribute('rel', 'canonical');
    this.dom.head.appendChild(link);
    link.setAttribute('href', this.dom.URL);
  }
  updateCanonicalUrl ( ) :void {
   let  url :HTMLLinkElement  = this.dom.head.querySelector(`link[rel='canonical']`)
   url.removeAttribute('href')
   url.setAttribute('href', this.dom.URL);

  }
}

</code>```

main component :

```<code>

  ngOnInit() {
    this.metaService.createCanonicalURL();
    this.router.events.subscribe((event) => {
      if (event instanceof NavigationEnd) {
        this.metaService.updateCanonicalUrl()
      }
    });

</code>```

I wanna figure out a way to make my canonical url https on the server side .

Body:
I'm using a simple function to dynamically change canonical url , the thing is when in production mode it renderers twice , once on the server side and once on the browser , which is not the issue I can choose to  make it render where I want , however my website has a valid HTTPS certificate yet , here is the issue , when it render in the server  it shows the canonical url with http:  but when it render in the browser it shows the url with Https: , ofcourse for SEO reasons the browser version does not mean anything to bot because when I inspect the source code the one with https does not show ( expected ) . but what I dont understant why is it Http when it render server side , I wanna make it https ! any idea ? ( sorry for my english ) .

here is some idea about the Code  :
Service

export class MetaService {
  renderer : Renderer2
  constructor( private rendererF : RendererFactory2 ,@Inject(DOCUMENT) private dom ) {
    this.renderer = rendererF.createRenderer(null, null);

  }

  createCanonicalURL(url?:string ) {
    let link: HTMLLinkElement = this.dom.createElement('link');
    link.setAttribute('rel', 'canonical');
    this.dom.head.appendChild(link);
    link.setAttribute('href', this.dom.URL);
  }
  updateCanonicalUrl ( ) :void {
   let  url :HTMLLinkElement  = this.dom.head.querySelector(`link[rel='canonical']`)
   url.removeAttribute('href')
   url.setAttribute('href', this.dom.URL);

  }
}

main component :

  ngOnInit() {
    this.metaService.createCanonicalURL();
    this.router.events.subscribe((event) => {
      if (event instanceof NavigationEnd) {
        this.metaService.updateCanonicalUrl()
      }
    });

I wanna figure out a way to make my canonical url https on the server side .


问:
input array data but why only the second data is entered, the first is empty
this code for edit data not for add data, problem with data editing. when i update the dropdown there is no problem but it doesn't change the value in the input, the second data comes in but the first one doesn't. when I add data there is no problem only when editing it

```<code>
 for ($i = 0; $i < $total; $i++) {

        $id_jenispengujian = $id_user[0] . $nomor[0] . $jenis[$i];
        $hasil = mysqli_query(konek::konekdb(), "INSERT INTO pemohon_uji
          (id_jenispengujian,
          jenis_pengujian,
          jumlah_uji,
          id_user,
          no_surat) values
          (
            '$id_jenispengujian',
            '$jenis[$i]',
            '$jumlah[$i]',
            '$id_user[0]',
            '$nomor[0]'
          )ON DUPLICATE KEY UPDATE
        id_jenispengujian = '$id_jenispengujian',
        jenis = '$jenis[$i]',
          jumlah_uji = '$jumlah[$i]',
          id_user = '$id_user[0]',
          no_surat = '$nomor[0]'");
    };

</code>```

[enter image description here](https://i.stack.imgur.com/YC0Ha.png)

both arrays are inputted properly

Body:
this code for edit data not for add data, problem with data editing. when i update the dropdown there is no problem but it doesn't change the value in the input, the second data comes in but the first one doesn't. when I add data there is no problem only when editing it

 for ($i = 0; $i < $total; $i++) {

        $id_jenispengujian = $id_user[0] . $nomor[0] . $jenis[$i];
        $hasil = mysqli_query(konek::konekdb(), "INSERT INTO pemohon_uji
          (id_jenispengujian,
          jenis_pengujian,
          jumlah_uji,
          id_user,
          no_surat) values
          (
            '$id_jenispengujian',
            '$jenis[$i]',
            '$jumlah[$i]',
            '$id_user[0]',
            '$nomor[0]'
          )ON DUPLICATE KEY UPDATE
        id_jenispengujian = '$id_jenispengujian',
        jenis = '$jenis[$i]',
          jumlah_uji = '$jumlah[$i]',
          id_user = '$id_user[0]',
          no_surat = '$nomor[0]'");
    };

[enter image description here](https://i.stack.imgur.com/YC0Ha.png)

both arrays are inputted properly


问:
Rendering particles inside HTML 5 Canvas
I am learing gamedev using HTML 5 Canvas and while writing my second game I got strange problem.
Long story short:  I create particles based on enemy size when projectile and enemy collide and than I want to render those particles on the canvas. Sadly even though the number of particles being pushed to the array is correct, I'm only getting one particle rendered on the screen. Can u provide any ideas or solutions for this?

```<code> particles.forEach((particle, idx) => {
    if (particle.alpha <= 0) particles.splice(idx, 1);
    else particle.update()
});
</code>```

And the update method that is rendering particles is:

```<code> draw() {
    c.save();
    c.globalAlpha = this._alpha;
    c.beginPath();
    c.arc(this._position.x, this._position.y, this._radius, 0, Math.PI * 2, false);
    c.fillStyle = this._color;
    c.fill();
    c.restore();
}

update() {
    this.draw();
    this._velocity.x *= friction;
    this._velocity.y *= friction;
    this._position.x += this._velocity.x;
    this._position.y += this._velocity.y;
    this._alpha -= 0.01;
}
</code>```

Lastly, the code to actually push new particle to the array is:

```<code>const createParticles = (enemy: Enemy, projectile: Projectile) => {
for (let i = 0; i < enemy.radius * 2; i++) {
    particles.push(new Particle({ position: projectile.position, radius: Math.random() * 2, color: enemy.color, velocity: {
        x: (Math.random() - 0.5) * (Math.random() * 2),
        y: (Math.random() - 0.5) * (Math.random() * 2)
    }}));
}}
</code>```

And the whole code can be found here: Click

I would appreciate any help, thanks :)

Body:
I am learing gamedev using HTML 5 Canvas and while writing my second game I got strange problem.
Long story short:  I create particles based on enemy size when projectile and enemy collide and than I want to render those particles on the canvas. Sadly even though the number of particles being pushed to the array is correct, I'm only getting one particle rendered on the screen. Can u provide any ideas or solutions for this?

 particles.forEach((particle, idx) => {
    if (particle.alpha <= 0) particles.splice(idx, 1);
    else particle.update()
});

And the update method that is rendering particles is:

 draw() {
    c.save();
    c.globalAlpha = this._alpha;
    c.beginPath();
    c.arc(this._position.x, this._position.y, this._radius, 0, Math.PI * 2, false);
    c.fillStyle = this._color;
    c.fill();
    c.restore();
}

update() {
    this.draw();
    this._velocity.x *= friction;
    this._velocity.y *= friction;
    this._position.x += this._velocity.x;
    this._position.y += this._velocity.y;
    this._alpha -= 0.01;
}

Lastly, the code to actually push new particle to the array is:

const createParticles = (enemy: Enemy, projectile: Projectile) => {
for (let i = 0; i < enemy.radius * 2; i++) {
    particles.push(new Particle({ position: projectile.position, radius: Math.random() * 2, color: enemy.color, velocity: {
        x: (Math.random() - 0.5) * (Math.random() * 2),
        y: (Math.random() - 0.5) * (Math.random() * 2)
    }}));
}}

And the whole code can be found here: Click

I would appreciate any help, thanks :)


问:
Clickfunnels promocode for multiple product
I did manage to hide the promo product but I cant catch the promocode to replace the regular product.
I have limited skill on coding and it drives me crazy to do this . Can someone help me through this . I just want a custom field or a field that can call the or take action when I type the promo code.</p>
```<code><script>

var mainProd = ['4302898', '4302891', '4302896'];
const linkedprod = [];
linkedprod[parseInt(mainProd[0])] = ['4362886', '4362878', '4362882'];
linkedprod[parseInt(mainProd[1])] = [];
linkedprod[parseInt(mainProd[2])] = [];
linkedprod[parseInt(mainProd[3])] = [];
var promoCodes = [];
promoCodes[parseInt(mainProd[0])] = ['INSIDER10', 'INSIDER10', 'INSIDER10'];
promoCodes[parseInt(mainProd[1])] = [];
promoCodes[parseInt(mainProd[2])] = [];
promoCodes[parseInt(mainProd[3])] = [];
var prodSelected = mainProd[0];
$(document).ready(function () {
  for(var i = 0; i < mainProd.length; i++){
    for(var u = 0; u < linkedprod[parseInt(mainProd[i])].length; u++){
        $('.elOrderProductOptinProductName [value='+linkedprod[parseInt(mainProd[i])][u]+']').closest('.elOrderProductOptinProducts').hide();
    }
  }

    $('input[name="purchase[product_id]"]').on('click', function(e){
      prodSelected = $(this).val();
    });

   $('input[data-custom-type="promo_code"]').on('keyup', function (e){
     try{
      var s = promoCodes[prodSelected].indexOf($(this).val());
      console.log("L31", prodSelected , promoCodes[prodSelected]);
     }catch(e){
       $('input#pid-'+mainProd[0]+'-1').click();
       console.log("error");
     }

      if(s === -1){ //NOT FOUND
        console.log(s);
        //$('input#pid-'+mainProd+'-1').click();
        $('.elOrderProductOptinProductName [value='+prodSelected+']').click();
      }else{
        var promoIdx = promoCodes[prodSelected].indexOf($(this).val());
        console.log("L38", $(this).val(), promoIdx);

        if(promoIdx === -1){ //not found
          $('input#pid-'+prodSelected+'-1').click();
        }else if (promoIdx >= 0){
          var ck = linkedprod[parseInt(prodSelected)][promoIdx];
          console.log('Found:', prodSelected, ck);

          if(typeof ck !== 'undefined')
            $('input#pid-'+ck+'-1').click();
          else
            $('input#pid-'+prodSelected+'-1').click();

        }else{
          $('input#pid-'+prodSelected+'-1').click();
        }

      }
    });
});
</script>

</code>```