问:
Chrome extensione gent result from div
I was trying to build a chrome extensione that was able to get a value from the current opened page (the value is inside a grid/table) and make some calculation on that.

I can get the value with this js command:

```<code>document.getElementById("dgrid_2-row-0").getElementsByClassName("dgrid-cell dgrid-cell-padding dgrid-column-0 field-field1").item(0).innerText
</code>```

But if I run in on simply extension with a popup I can't get the value because was in another page, this is why I follow background and chrome example tutorial to build this architecture.

backgound.js

```<code>chrome.action.onClicked.addListener((tab) => {
    console.log('Injecting content script(s)');
    //On Firefox document.body.textContent is probably more appropriate
    chrome.tabs.executeScript(tab.id,{
        code: '(function (){return document.getElementById("dgrid_2-row-0").getElementsByClassName("dgrid-cell dgrid-cell-padding dgrid-column-0 field-field1").item(0).innerText})();'
    },receiveText);
});

function receiveText(resultsArray){
    chrome.extension.getBackgroundPage().console.log('foo');
    //console.log(resultsArray[0]);
}
</code>```

manifest.json

```<code>{
  "name": "test",
  "action": {
        "default_popup": "index.html",
        "default_title": "test" },
  "manifest_version": 3,
  "version": "0.1",
  "description": "",
  "permissions": [
    "activeTab",
    "scripting"
  ],
  "background": {
    "service_worker": "background.js"
  }
}
</code>```

index.html An empty table to use when I'm able to get the result...

```<code><html>
<head>
    <title>I Have To Go Out!</title>
    <meta charset="utf-8">
</head>
<body>
<div class="container mt-3" style="width: 450px;">
        <h2 class="text-center">Report</h2>
        <table class="table table-bordered">
            <thead>
            <tr>
                <th>Entrance</th>
                <th>Country</th>
                <th>Confirmed</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td id="date"></td>
                <td id="areaName"></td>
                <td id="latestBy"></td>
            </tr>
            </tbody>
        </table>
    </div>
</body>
</html>
</code>```

All seems works fine because I don't have error when I run it but I have two problems, the first is that I can't see anything logged on console, also inspecting the console of the exstension, and the second one, that I can't understand, how I can get the return value and use it on the index.html??

My idea was I can add another script on index.html, loaded by

```<code><script src="script.js"></script>
</code>```

and use the result from background to add some value. Can you help me with some advide or linking an example?

EDIT after few comments:
I have changed the index.html to run script.js when opened

script.js

```<code>chrome.tabs.executeScript(tab.id,{
    code: 'alert('"test"')';
});
</code>```

but I can't see the test message. If I change script.js to

```<code>alert('test')
</code>```

I have the "test" message. If, instead of the alert, I set something like

```<code> document.body.style.backgroundColor = 'blue';
</code>```

the HTML table background color became blue but this is not I looking for, becuase I want to get value from document on opened Chrome tab. What I misunderstood?

Title: Chrome extensione gent result from div

Body:
I was trying to build a chrome extensione that was able to get a value from the current opened page (the value is inside a grid/table) and make some calculation on that.

I can get the value with this js command:

document.getElementById("dgrid_2-row-0").getElementsByClassName("dgrid-cell dgrid-cell-padding dgrid-column-0 field-field1").item(0).innerText

But if I run in on simply extension with a popup I can't get the value because was in another page, this is why I follow background and chrome example tutorial to build this architecture.

backgound.js

chrome.action.onClicked.addListener((tab) => {
    console.log('Injecting content script(s)');
    //On Firefox document.body.textContent is probably more appropriate
    chrome.tabs.executeScript(tab.id,{
        code: '(function (){return document.getElementById("dgrid_2-row-0").getElementsByClassName("dgrid-cell dgrid-cell-padding dgrid-column-0 field-field1").item(0).innerText})();'
    },receiveText);
});

function receiveText(resultsArray){
    chrome.extension.getBackgroundPage().console.log('foo');
    //console.log(resultsArray[0]);
}

manifest.json

{
  "name": "test",
  "action": {
        "default_popup": "index.html",
        "default_title": "test" },
  "manifest_version": 3,
  "version": "0.1",
  "description": "",
  "permissions": [
    "activeTab",
    "scripting"
  ],
  "background": {
    "service_worker": "background.js"
  }
}

index.html An empty table to use when I'm able to get the result...

    <title>I Have To Go Out!</title>
    <meta charset="utf-8">

Report

                Entrance
                Country
                Confirmed

All seems works fine because I don't have error when I run it but I have two problems, the first is that I can't see anything logged on console, also inspecting the console of the exstension, and the second one, that I can't understand, how I can get the return value and use it on the index.html??

My idea was I can add another script on index.html, loaded by

and use the result from background to add some value. Can you help me with some advide or linking an example?

EDIT after few comments:
I have changed the index.html to run script.js when opened

script.js

chrome.tabs.executeScript(tab.id,{
    code: 'alert('"test"')';
});

but I can't see the test message. If I change script.js to

alert('test')

I have the "test" message. If, instead of the alert, I set something like

 document.body.style.backgroundColor = 'blue';

the HTML table background color became blue but this is not I looking for, becuase I want to get value from document on opened Chrome tab. What I misunderstood?


来源: stackexchange

问:
Items in List not showing in inspector
I have a function that looks for a "Tile" on a certain position, adds that to a list and then returns that list to a different list. However, no list items are displayed in the inspector when the game runs, even tho when i use debugging or Debug.Log, it shows the list contains the correct "Tile".

Here is my code:

```<code>using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PieceController : MonoBehaviour
{
    [Header("Location managing")]
    public Tile currentTile;
    public Vector3 currentTilePos;

    [Header("Move making")]
    public Piece pieceType;
    public List<Tile> validTiles = new List<Tile>();

    private TileSelector tileSelector;

    // Start is called before the first frame update
    void Start()
    {
        tileSelector = GameObject.Find("GameController").GetComponent<TileSelector>();

    }

    // Update is called once per frame
    void Update()
    {
        currentTilePos = currentTile.GetComponent<Tile>().positionTop;
        validTiles = CalculateValidTiles();

        Debug.Log("Valid tiles: " + validTiles.ToString());
    }

    public List<Tile> CalculateValidTiles()
    {
        float tileLength = pieceType.tileLength;
        List<Tile> tiles = new List<Tile>();

        foreach (LegalMove move in pieceType.moves)
        {
            //Debug.Log("Calculating move: " + move.name);

            Vector3 legalPosition;
            Vector3 originPosition = transform.position;

            legalPosition = new Vector3(originPosition.x + move.tilesPositiveX, originPosition.y, originPosition.z + move.tilesPositiveZ);

            //Debug.Log("Legal position: " + legalPosition.ToString());

            Ray ray = new Ray(legalPosition, Vector3.down);
            RaycastHit hit;

            if (Physics.Raycast(ray, out hit, 1.5f))
            {
                Debug.Log("Hit: " + hit.collider.gameObject.name);

                if (hit.collider.gameObject.tag == "piece" && !validTiles.Contains(hit.collider.gameObject.GetComponent<Tile>()))
                {
                    tiles.Add(hit.collider.gameObject.GetComponent<Tile>());

                    //Debug.Log("Added tile: " + hit.collider.gameObject.GetComponent<Tile>().tile);
                }
            }
        }

        Debug.Log("Tiles calculated: " + tiles.ToString());

        return tiles;
    }

}
</code>```

I can't figure out why it won't show the items in the inspector. I've tried updating my editor version to 2021.3.14f1, and adding items to the "validTiles" list directly, instead of using a return.

ContentLicense: CC BY-SA 4.0

Title: Items in List not showing in inspector

Body:
I have a function that looks for a "Tile" on a certain position, adds that to a list and then returns that list to a different list. However, no list items are displayed in the inspector when the game runs, even tho when i use debugging or Debug.Log, it shows the list contains the correct "Tile".

Here is my code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PieceController : MonoBehaviour
{
    [Header("Location managing")]
    public Tile currentTile;
    public Vector3 currentTilePos;

    [Header("Move making")]
    public Piece pieceType;
    public List<Tile> validTiles = new List<Tile>();

    private TileSelector tileSelector;

    // Start is called before the first frame update
    void Start()
    {
        tileSelector = GameObject.Find("GameController").GetComponent<TileSelector>();

    }

    // Update is called once per frame
    void Update()
    {
        currentTilePos = currentTile.GetComponent<Tile>().positionTop;
        validTiles = CalculateValidTiles();

        Debug.Log("Valid tiles: " + validTiles.ToString());
    }

    public List<Tile> CalculateValidTiles()
    {
        float tileLength = pieceType.tileLength;
        List<Tile> tiles = new List<Tile>();

        foreach (LegalMove move in pieceType.moves)
        {
            //Debug.Log("Calculating move: " + move.name);

            Vector3 legalPosition;
            Vector3 originPosition = transform.position;

            legalPosition = new Vector3(originPosition.x + move.tilesPositiveX, originPosition.y, originPosition.z + move.tilesPositiveZ);

            //Debug.Log("Legal position: " + legalPosition.ToString());

            Ray ray = new Ray(legalPosition, Vector3.down);
            RaycastHit hit;

            if (Physics.Raycast(ray, out hit, 1.5f))
            {
                Debug.Log("Hit: " + hit.collider.gameObject.name);

                if (hit.collider.gameObject.tag == "piece" && !validTiles.Contains(hit.collider.gameObject.GetComponent<Tile>()))
                {
                    tiles.Add(hit.collider.gameObject.GetComponent<Tile>());

                    //Debug.Log("Added tile: " + hit.collider.gameObject.GetComponent<Tile>().tile);
                }
            }
        }

        Debug.Log("Tiles calculated: " + tiles.ToString());

        return tiles;
    }

}

I can't figure out why it won't show the items in the inspector. I've tried updating my editor version to 2021.3.14f1, and adding items to the "validTiles" list directly, instead of using a return.


问:
How to prevent typescript compiler from using shorthand object property names?
I'm trying to figure out how to compile my typescript to JS but to have it not use short hand object names

{a,b,c}
to
{a:a, b:b, c:c}

is this possible?


问:
Creating otel Extensions jar with maven not gradle
I am using opentelemetry-javaagent.jar. I am trying to create extensions to add in -Dotel.javaagent.extensions. The jar file I am creating with is maven. Its not working. On there official site they have used gradle.
Could you help me what am I doing wrong?</p>


问:
TimedRotatingFileHandler -> rotate file every midnight + 1h
How to set up the method associated with the the file handler rotation in order to rotate the files every midnight + 1h. Maybe Should I use atTime param.?</p>
```<code>timeTimedRotatingFileHandler(log_file, when="midnight", interval=1)
</code>```

Body:
How to set up the method associated with the the file handler rotation in order to rotate the files every midnight + 1h. Maybe Should I use atTime param.?

timeTimedRotatingFileHandler(log_file, when="midnight", interval=1)


Title: why is MIDI scripter dropping events after 20x loops in MainStage 3

Body:
my drum riff script seems to work up until the riff is repeated (i think around) 20 times. then some notes like snare... start to dissappear. if i hit the global stop and play again it works. also if i reload the script it doesn't help which makes me think... but come up with the road to nowhere. any ideas?

The problem starts at beat position 640 (20x 32 beats per loop).

const riffs = [
['11th Hour',[[1,49,114,1,0],[0,49,0,1.25,0],[1,46,89,1.501,20],[1,36,101,1.748,0],[0,46,0,1.751,20],[0,36,0,1.998,0],[1,46,92,2.001,30],[0,46,0,2.251,30],[1,36,114,2.495,0],[1,46,84,2.498,30],[0,36,0,2.745,0],[0,46,0,2.748,30],[1,38,120,2.999,0],[1,46,113,3.003,30],[0,38,64,3.249,0],[0,46,0,3.253,30],[1,46,85,3.499,20],[0,46,0,3.749,20],[1,46,88,4.002,30],[0,46,0,4.252,30],[1,46,87,4.504,30],[1,36,77,4.743,0],[0,46,0,4.754,30],[0,36,0,4.993,0],[1,36,114,4.999,0],[1,46,107,5.002,30],[0,36,0,5.249,0],[0,46,0,5.252,30],[1,46,82,5.506,30],[1,36,106,5.744,0],[0,46,0,5.756,30],[0,36,0,5.994,0],[1,46,92,5.999,30],[0,46,0,6.249,30],[1,36,114,6.489,0],[1,46,84,6.504,20],[0,36,0,6.739,0],[0,46,0,6.754,20],[1,46,113,6.992,30],[1,38,120,7,0],[0,46,0,7.242,30],[0,38,64,7.25,0],[1,46,81,7.505,20],[0,46,0,7.755,20],[1,46,90,7.999,30],[1,36,102,8.243,0],[0,46,0,8.248,30],[0,36,0,8.493,0],[1,38,120,8.495,0],[1,46,113,8.498,30],[0,38,64,8.745,0],[0,46,0,8.748,30],[1,36,114,8.995,0],[1,46,107,9.002,30],[0,36,0,9.245,0],[0,46,0,9.252,30],[1,46,85,9.502,20],[1,36,101,9.745,0],[0,46,0,9.752,20],[0,36,0,9.995,0],[1,46,93,9.998,30],[0,46,0,10.248,30],[1,36,114,10.49,0],[1,46,84,10.498,20],[0,36,0,10.74,0],[0,46,0,10.748,20],[1,38,120,10.995,0],[1,46,113,10.998,30],[0,38,64,11.245,0],[0,46,0,11.248,30],[1,46,81,11.495,30],[0,46,0,11.745,30],[1,46,90,12,30],[0,46,0,12.25,30],[1,46,84,12.498,20],[1,36,77,12.737,0],[0,46,0,12.748,20],[0,36,0,12.988,0],[1,36,114,12.994,0],[1,46,107,13,30],[0,36,0,13.244,0],[0,46,0,13.25,30],[1,46,88,13.498,30],[1,36,104,13.734,0],[0,46,0,13.748,30],[0,36,0,13.984,0],[1,46,86,13.995,30],[0,46,0,14.245,30],[1,36,114,14.494,0],[1,46,89,14.501,20],[0,36,0,14.744,0],[0,46,0,14.751,20],[1,46,113,14.99,30],[1,38,120,14.994,0],[0,46,0,15.24,30],[1,36,99,15.242,0],[0,38,64,15.244,0],[0,36,0,15.492,0],[1,46,88,15.501,20],[1,36,106,15.735,0],[0,46,0,15.751,20],[0,36,0,15.985,0],[1,46,89,15.997,30],[0,46,0,16.247,30],[1,38,83,16.49,0],[0,38,64,16.74,0],[1,40,105,16.743,0],[1,57,114,16.991,0],[0,40,64,16.993,0],[1,36,114,16.993,0],[0,57,0,17.241,0],[0,36,0,17.243,0],[1,46,86,17.499,30],[1,36,101,17.744,0],[0,46,0,17.749,30],[0,36,0,17.994,0],[1,46,88,18,30],[0,46,0,18.25,30],[1,36,114,18.494,0],[1,46,84,18.499,30],[0,36,0,18.744,0],[0,46,0,18.749,30],[1,46,113,19,30],[1,38,120,19.003,0],[0,46,0,19.25,30],[0,38,64,19.253,0],[1,46,81,19.503,20],[0,46,0,19.753,20],[1,46,91,19.999,30],[0,46,0,20.249,30],[1,46,84,20.5,30],[0,46,0,20.75,30],[1,36,114,20.998,0],[1,46,107,20.999,30],[0,36,0,21.248,0],[0,46,0,21.249,30],[1,46,85,21.502,20],[1,36,98,21.74,0],[0,46,0,21.752,20],[0,36,0,21.99,0],[1,46,85,22.003,30],[0,46,0,22.253,30],[1,36,114,22.497,0],[1,46,86,22.5,20],[0,36,0,22.747,0],[0,46,0,22.75,20],[1,46,113,22.992,30],[1,38,120,23,0],[0,46,0,23.242,30],[0,38,64,23.25,0],[1,46,85,23.502,30],[0,46,0,23.752,30],[1,46,91,24.002,30],[1,36,99,24.241,0],[0,46,0,24.252,30],[0,36,0,24.491,0],[1,38,120,24.496,0],[1,46,113,24.502,30],[0,38,64,24.746,0],[0,46,0,24.752,30],[1,36,114,24.996,0],[1,46,107,24.996,30],[0,46,0,25.246,30],[0,36,0,25.246,0],[1,46,89,25.498,20],[1,36,102,25.743,0],[0,46,0,25.748,20],[0,36,0,25.993,0],[1,46,91,25.999,30],[0,46,0,26.249,30],[1,36,114,26.49,0],[1,46,88,26.503,20],[0,36,0,26.74,0],[0,46,0,26.753,20],[1,46,113,26.994,30],[1,38,120,27.001,0],[0,46,0,27.244,30],[0,38,64,27.251,0],[1,46,89,27.5,30],[0,46,0,27.75,30],[1,46,93,28,30],[0,46,0,28.25,30],[1,46,81,28.499,20],[0,46,0,28.749,20],[1,36,114,28.997,0],[1,46,107,29,30],[0,36,0,29.247,0],[0,46,0,29.25,30],[1,46,86,29.505,30],[1,36,105,29.741,0],[0,46,0,29.755,30],[0,36,0,29.991,0],[1,46,94,30,30],[0,46,0,30.25,30],[1,36,114,30.498,0],[1,46,86,30.501,30],[0,36,0,30.748,0],[0,46,0,30.751,30],[1,46,113,30.997,30],[1,38,120,30.998,0],[0,46,0,31.247,30],[0,38,64,31.248,0],[1,36,102,31.492,0],[1,46,86,31.503,30],[0,36,64,31.742,0],[0,46,0,31.753,30],[1,47,99,31.992,0],[1,33,110,31.994,0],[1,40,110,32.008,0],[0,47,64,32.241,0],[0,33,64,32.244,0],[0,40,64,32.258,0],[1,36,86,32.494,0],[0,36,64,32.744,0]]],
['Black Veil',[[1,36,118,0.994,0],[1,33,39,0.998,0],[1,57,118,1.002,0],[0,36,0,1.244,0],[0,33,64,1.248,0],[0,57,0,1.252,0],[1,45,72,1.497,0],[1,33,13,1.501,0],[1,36,87,1.738,0],[0,45,0,1.747,0],[0,33,64,1.751,0],[0,36,0,1.987,0],[1,45,86,1.999,0],[1,33,39,2.001,0],[1,38,123,2.003,0],[0,45,0,2.249,0],[0,33,64,2.252,0],[0,38,0,2.253,0],[1,45,72,2.501,0],[1,33,7,2.502,0],[1,36,62,2.748,0],[0,45,0,2.751,0],[0,33,64,2.752,0],[1,33,41,2.993,0],[1,36,118,2.995,0],[0,36,0,2.995,0],[1,45,88,2.996,0],[0,33,64,3.243,0],[0,36,0,3.245,0],[0,45,0,3.246,0],[1,45,73,3.498,0],[1,33,13,3.503,0],[0,45,0,3.748,0],[0,33,64,3.753,0],[1,45,85,3.999,0],[1,33,36,4.002,0],[1,38,123,4.003,0],[0,45,0,4.249,0],[0,33,64,4.252,0],[0,38,0,4.253,0],[1,45,72,4.502,0],[1,33,7,4.504,0],[0,45,0,4.752,0],[0,33,64,4.754,0],[1,36,118,4.997,0],[1,33,40,5.003,0],[1,45,80,5.003,0],[0,36,0,5.247,0],[0,45,0,5.253,0],[0,33,64,5.253,0],[1,45,74,5.502,0],[1,33,11,5.504,0],[1,36,92,5.738,0],[0,45,0,5.752,0],[0,33,64,5.754,0],[0,36,0,5.988,0],[1,45,84,6,0],[1,33,35,6.001,0],[1,38,123,6.002,0],[1,36,88,6.242,0],[0,45,0,6.25,0],[0,33,64,6.251,0],[0,38,0,6.252,0],[0,36,0,6.492,0],[1,33,8,6.498,0],[1,45,72,6.501,0],[1,36,61,6.741,0],[0,33,64,6.748,0],[0,45,0,6.751,0],[0,36,0,6.991,0],[1,45,87,6.992,0],[1,33,41,6.996,0],[1,36,118,6.996,0],[0,45,0,7.242,0],[0,36,0,7.246,0],[0,33,64,7.246,0],[1,36,93,7.49,0],[1,45,81,7.499,0],[1,33,16,7.503,0],[0,36,0,7.74,0],[0,45,0,7.749,0],[0,33,64,7.753,0],[1,45,81,7.997,0],[1,33,34,8,0],[1,38,123,8,0],[0,45,0,8.247,0],[0,33,64,8.25,0],[0,38,0,8.251,0],[1,45,69,8.497,0],[1,33,16,8.503,0],[0,45,0,8.747,0],[0,33,64,8.753,0],[1,36,118,8.997,0],[1,33,40,9,0],[1,45,84,9.002,0],[0,36,0,9.247,0],[0,33,64,9.25,0],[0,45,0,9.252,0],[1,45,76,9.495,0],[1,33,5,9.497,0],[0,45,0,9.745,0],[0,33,64,9.747,0],[1,38,123,9.998,0],[1,45,84,10,0],[1,33,33,10.001,0],[0,38,0,10.248,0],[0,45,0,10.25,0],[0,33,64,10.251,0],[1,45,73,10.495,0],[1,33,12,10.504,0],[1,36,62,10.742,0],[0,45,0,10.745,0],[0,33,64,10.754,0],[1,45,86,10.991,0],[0,36,0,10.992,0],[1,36,118,10.993,0],[1,33,35,10.998,0],[0,45,0,11.241,0],[0,36,0,11.243,0],[0,33,64,11.248,0],[1,45,77,11.497,0],[1,33,15,11.503,0],[0,45,0,11.747,0],[0,33,64,11.753,0],[1,45,82,11.997,0],[1,38,123,11.998,0],[1,33,36,12,0],[1,36,91,12.238,0],[0,45,0,12.247,0],[0,38,0,12.248,0],[0,33,64,12.25,0],[0,36,0,12.488,0],[1,45,71,12.494,0],[1,33,10,12.495,0],[0,45,0,12.744,0],[0,33,64,12.745,0],[1,36,118,12.995,0],[1,33,37,12.997,0],[1,45,82,13,0],[0,36,0,13.245,0],[0,33,64,13.247,0],[0,45,0,13.25,0],[1,33,12,13.495,0],[1,45,69,13.498,0],[1,36,85,13.738,0],[0,33,64,13.745,0],[0,45,0,13.748,0],[0,36,0,13.988,0],[1,45,86,13.995,0],[1,33,42,13.995,0],[1,38,123,14,0],[1,36,92,14.234,0],[0,45,0,14.245,0],[0,33,64,14.245,0],[0,38,0,14.25,0],[0,36,0,14.484,0],[1,45,70,14.493,0],[1,33,7,14.501,0],[0,45,0,14.743,0],[1,36,63,14.743,0],[0,33,64,14.751,0],[1,45,82,14.99,0],[0,36,0,14.993,0],[1,33,43,14.995,0],[1,36,118,14.995,0],[0,45,0,15.24,0],[0,36,0,15.245,0],[0,33,64,15.245,0],[1,36,93,15.491,0],[1,33,15,15.498,0],[1,45,89,15.498,0],[0,36,0,15.741,0],[0,33,64,15.748,0],[0,45,0,15.748,0],[1,47,116,15.993,0],[1,45,86,15.995,0],[1,33,41,15.997,0],[1,36,85,16.241,0],[0,47,64,16.243,0],[0,45,0,16.245,0],[0,33,64,16.247,0],[0,36,64,16.361,0],[1,36,99,16.363,0],[1,47,116,16.496,0],[1,45,77,16.497,0],[1,33,6,16.503,0],[0,36,64,16.612,0],[1,36,107,16.736,0],[0,47,64,16.746,0],[0,45,0,16.747,0],[0,33,64,16.753,0],[0,36,64,16.986,0],[1,36,118,16.995,0],[1,33,32,16.996,0],[1,57,118,16.999,0],[0,36,0,17.245,0],[0,33,64,17.246,0],[0,57,0,17.249,0],[1,45,74,17.494,0],[1,33,7,17.502,0],[0,45,0,17.744,0],[1,36,84,17.745,0],[0,33,64,17.752,0],[0,36,0,17.995,0],[1,45,86,17.996,0],[1,38,123,18,0],[1,33,38,18.001,0],[0,45,0,18.246,0],[0,38,0,18.25,0],[0,33,64,18.251,0],[1,33,10,18.499,0],[1,45,78,18.5,0],[1,36,57,18.741,0],[0,33,64,18.749,0],[0,45,0,18.75,0],[0,36,0,18.991,0],[1,36,118,18.994,0],[1,33,43,18.995,0],[1,45,85,19,0],[0,36,0,19.244,0],[0,33,64,19.245,0],[0,45,0,19.25,0],[1,45,75,19.499,0],[1,33,5,19.503,0],[0,45,0,19.749,0],[0,33,64,19.753,0],[1,33,42,19.999,0],[1,45,86,19.999,0],[1,38,123,20.003,0],[0,45,0,20.249,0],[0,33,64,20.249,0],[0,38,0,20.253,0],[1,45,77,20.501,0],[1,33,12,20.505,0],[0,45,0,20.751,0],[0,33,64,20.755,0],[1,33,32,20.994,0],[1,45,81,20.994,0],[1,36,118,20.998,0],[0,45,0,21.244,0],[0,33,64,21.244,0],[0,36,0,21.248,0],[1,45,70,21.499,0],[1,33,8,21.502,0],[1,36,88,21.748,0],[0,45,0,21.749,0],[0,33,64,21.752,0],[0,36,0,21.998,0],[1,33,43,21.999,0],[1,45,88,21.999,0],[1,38,123,22.003,0],[0,45,0,22.249,0],[0,33,64,22.249,0],[0,38,0,22.253,0],[1,33,14,22.498,0],[1,45,72,22.501,0],[1,36,59,22.747,0],[0,33,64,22.748,0],[0,45,0,22.751,0],[1,45,89,22.992,0],[0,36,0,22.994,0],[1,36,118,22.994,0],[1,33,36,23.001,0],[0,45,0,23.242,0],[0,36,0,23.244,0],[0,33,64,23.251,0],[1,36,93,23.493,0],[1,45,79,23.496,0],[1,33,15,23.505,0],[0,36,0,23.743,0],[0,45,0,23.746,0],[0,33,64,23.755,0],[1,33,33,23.999,0],[1,45,89,23.999,0],[1,38,123,24.003,0],[1,36,91,24.24,0],[0,45,0,24.249,0],[0,33,64,24.249,0],[0,38,0,24.253,0],[0,36,0,24.49,0],[1,45,77,24.494,0],[1,33,11,24.503,0],[0,45,0,24.744,0],[0,33,64,24.753,0],[1,33,41,24.996,0],[1,45,80,24.996,0],[1,36,118,24.998,0],[0,45,0,25.246,0],[0,33,64,25.246,0],[0,36,0,25.248,0],[1,33,11,25.498,0],[1,45,74,25.499,0],[1,36,86,25.745,0],[0,33,64,25.748,0],[0,45,0,25.749,0],[0,36,0,25.995,0],[1,38,123,26,0],[1,45,88,26.001,0],[1,33,41,26.002,0],[0,38,0,26.25,0],[0,45,0,26.251,0],[0,33,64,26.252,0],[1,33,8,26.498,0],[1,45,71,26.499,0],[1,36,56,26.737,0],[0,33,64,26.748,0],[0,45,0,26.749,0],[0,36,0,26.988,0],[1,33,35,26.994,0],[1,36,118,26.994,0],[1,45,89,27.001,0],[0,36,0,27.244,0],[0,33,64,27.244,0],[0,45,0,27.251,0],[1,45,71,27.495,0],[1,33,13,27.505,0],[0,45,0,27.745,0],[0,33,64,27.755,0],[1,45,87,28.001,0],[1,33,41,28.002,0],[1,38,123,28.003,0],[0,45,0,28.251,0],[0,33,64,28.252,0],[0,38,0,28.253,0],[1,45,77,28.499,0],[1,33,8,28.501,0],[0,45,0,28.749,0],[0,33,64,28.751,0],[1,36,118,28.994,0],[1,45,84,28.999,0],[1,33,43,29.002,0],[1,36,80,29.243,0],[0,36,0,29.243,0],[0,45,0,29.249,0],[0,33,64,29.252,0],[0,36,0,29.493,0],[1,45,70,29.495,0],[1,33,13,29.501,0],[1,36,86,29.742,0],[0,45,0,29.745,0],[0,33,64,29.751,0],[0,36,0,29.992,0],[1,45,87,30,0],[1,38,123,30.001,0],[1,33,35,30.002,0],[0,45,0,30.25,0],[0,38,0,30.251,0],[0,33,64,30.252,0],[1,45,77,30.497,0],[1,33,14,30.498,0],[1,36,58,30.745,0],[0,45,0,30.747,0],[0,33,64,30.748,0],[0,36,0,30.995,0],[1,40,116,31.015,0],[1,40,116,31.232,0],[0,40,64,31.233,0],[0,40,64,31.482,0],[1,38,104,31.498,0],[1,38,48,31.744,0],[0,38,64,31.744,0],[0,38,64,31.994,0],[1,40,116,31.999,0],[1,38,104,32.244,0],[0,40,64,32.248,0],[0,38,64,32.494,0],[1,38,114,32.498,0],[1,38,104,32.741,0],[0,38,64,32.741,0],[0,38,64,32.992,0]]],
['Crimson',[[1,49,117,0.999,0],[1,36,116,1,0],[0,49,0,1.249,0],[0,36,0,1.25,0],[1,57,76,1.507,0],[0,57,0,1.757,0],[1,57,93,2.005,0],[1,38,122,2.008,0],[0,57,0,2.255,0],[0,38,0,2.258,0],[1,57,83,2.51,0],[1,36,94,2.745,0],[0,57,0,2.76,0],[0,36,0,2.995,0],[1,57,78,3.006,0],[1,36,74,3.251,0],[0,57,0,3.256,0],[0,36,0,3.499,0],[1,36,116,3.499,0],[1,57,89,3.507,0],[0,36,0,3.749,0],[0,57,0,3.757,0],[1,57,99,4.006,0],[1,38,122,4.011,0],[0,57,0,4.257,0],[0,38,0,4.261,0],[1,57,74,4.511,0],[0,57,0,4.761,0],[1,36,116,5.001,0],[1,57,94,5.006,0],[0,36,0,5.251,0],[0,57,0,5.256,0],[1,57,65,5.513,0],[1,36,99,5.744,0],[0,57,0,5.763,0],[0,36,0,5.994,0],[1,57,91,6.006,0],[1,38,122,6.008,0],[0,57,0,6.256,0],[0,38,0,6.258,0],[1,57,76,6.505,0],[1,36,95,6.752,0],[0,57,0,6.755,0],[0,36,0,7.002,0],[1,57,79,7.004,0],[0,57,0,7.254,0],[1,36,116,7.499,0],[1,57,78,7.511,0],[0,36,0,7.749,0],[0,57,0,7.761,0],[1,38,122,8.007,0],[1,57,88,8.007,0],[1,36,96,8.245,0],[0,57,0,8.257,0],[0,38,0,8.257,0],[0,36,0,8.495,0],[1,36,115,8.498,0],[1,57,80,8.506,0],[0,36,0,8.748,0],[0,57,0,8.756,0],[1,57,93,8.997,0],[1,36,116,9.001,0],[0,57,0,9.247,0],[0,36,0,9.251,0],[1,57,75,9.505,0],[0,57,0,9.755,0],[1,38,122,10.005,0],[1,57,105,10.008,0],[0,38,0,10.255,0],[0,57,0,10.258,0],[1,57,76,10.505,0],[1,36,97,10.748,0],[0,57,0,10.755,0],[0,36,0,10.998,0],[1,57,80,11,0],[0,57,0,11.25,0],[1,36,116,11.495,0],[1,57,82,11.506,0],[0,36,0,11.745,0],[0,57,0,11.756,0],[1,57,98,12.005,0],[1,38,122,12.008,0],[1,36,98,12.243,0],[0,57,0,12.255,0],[0,38,0,12.258,0],[0,36,0,12.493,0],[1,57,80,12.507,0],[0,57,0,12.757,0],[1,36,116,12.998,0],[1,57,93,13.006,0],[0,36,0,13.248,0],[0,57,0,13.256,0],[1,57,74,13.507,0],[1,36,92,13.743,0],[0,57,0,13.757,0],[0,36,0,13.993,0],[1,38,122,14.003,0],[1,57,90,14.004,0],[0,38,0,14.253,0],[0,57,0,14.254,0],[1,57,75,14.505,0],[1,36,99,14.748,0],[0,57,0,14.755,0],[0,36,0,14.998,0],[1,57,84,15.003,0],[1,36,75,15.248,0],[0,57,0,15.253,0],[0,36,0,15.498,0],[1,36,116,15.498,0],[1,57,81,15.507,0],[0,36,0,15.748,0],[0,57,0,15.757,0],[1,57,89,16.007,0],[1,38,122,16.008,0],[1,36,94,16.243,0],[0,57,0,16.257,0],[0,38,0,16.258,0],[1,48,111,16.478,0],[0,36,0,16.493,0],[1,45,118,16.51,0],[0,48,64,16.728,0],[0,45,64,16.751,0],[1,45,112,16.751,0],[1,49,117,17,0],[0,45,64,17.001,0],[1,36,116,17.002,0],[0,49,0,17.25,0],[0,36,0,17.252,0],[1,57,86,17.505,0],[0,57,0,17.755,0],[1,57,104,18.004,0],[1,38,122,18.009,0],[0,57,0,18.254,0],[0,38,0,18.259,0],[1,57,76,18.507,0],[1,36,91,18.754,0],[0,57,0,18.757,0],[1,57,81,19.003,0],[0,36,0,19.004,0],[0,57,0,19.253,0],[1,36,116,19.499,0],[1,57,96,19.504,0],[0,36,0,19.749,0],[0,57,0,19.754,0],[1,57,102,20.007,0],[1,38,122,20.008,0],[1,36,92,20.251,0],[0,57,0,20.257,0],[0,38,0,20.258,0],[0,36,0,20.501,0],[1,57,68,20.511,0],[0,57,0,20.761,0],[1,36,116,21.002,0],[1,57,99,21.007,0],[0,36,0,21.252,0],[0,57,0,21.257,0],[1,57,84,21.513,0],[1,36,95,21.747,0],[0,57,0,21.763,0],[0,36,0,21.997,0],[1,38,122,22.006,0],[1,57,100,22.009,0],[0,38,0,22.256,0],[0,57,0,22.259,0],[1,57,83,22.511,0],[1,36,94,22.752,0],[0,57,0,22.761,0],[0,36,0,23.002,0],[1,57,66,23.005,0],[1,36,75,23.245,0],[0,57,0,23.255,0],[0,36,0,23.495,0],[1,36,116,23.501,0],[1,57,85,23.508,0],[0,36,0,23.751,0],[0,57,0,23.758,0],[1,57,105,24.007,0],[1,38,122,24.01,0],[0,57,0,24.257,0],[0,38,0,24.26,0],[1,57,72,24.511,0],[0,57,0,24.761,0],[1,57,99,24.998,0],[1,36,116,25.004,0],[0,57,0,25.248,0],[0,36,0,25.254,0],[1,57,69,25.504,0],[1,36,93,25.751,0],[0,57,0,25.754,0],[0,36,0,26.001,0],[1,57,91,26.005,0],[1,38,122,26.006,0],[0,57,0,26.255,0],[0,38,0,26.256,0],[1,57,79,26.509,0],[1,36,91,26.75,0],[0,57,0,26.759,0],[0,36,0,27,0],[1,57,81,27.005,0],[0,57,0,27.255,0],[1,36,116,27.499,0],[1,57,97,27.504,0],[0,36,0,27.749,0],[0,57,0,27.754,0],[1,57,88,28.007,0],[1,38,122,28.009,0],[0,57,0,28.257,0],[0,38,0,28.259,0],[1,57,78,28.507,0],[0,57,0,28.757,0],[1,36,116,29.003,0],[1,57,101,29.007,0],[0,36,0,29.253,0],[0,57,0,29.257,0],[1,57,78,29.511,0],[1,36,96,29.75,0],[0,57,0,29.761,0],[0,36,0,30,0],[1,38,122,30.006,0],[1,57,89,30.008,0],[0,38,0,30.256,0],[0,57,0,30.258,0],[1,57,73,30.506,0],[1,36,93,30.755,0],[0,57,0,30.756,0],[1,57,83,30.998,0],[0,36,0,31.005,0],[1,36,70,31.246,0],[0,57,0,31.248,0],[1,48,104,31.484,0],[0,36,0,31.496,0],[1,47,102,31.521,0],[0,48,64,31.734,0],[1,36,112,31.748,0],[0,47,64,31.771,0],[0,36,64,31.998,0],[1,36,112,32.252,0],[1,47,98,32.461,0],[0,36,64,32.502,0],[1,43,107,32.518,0],[0,47,64,32.711,0],[0,43,64,32.768,0]]]
];

var riffData = riffs[0][1];

var NeedsTimingInfo = true;
var ResetParameterDefaults = true;

function ParameterChanged(index, value)
 {
    var name = PluginParameters[index].name;
    Trace("parameterChanged($index:"+index+" ["+name+"], $value:"+value+")");
    if (name == 'Riff')
     {
        setRiff(value);
     }
 }

function setRiff(riff)
 {
    Trace("Riff Changed To: "+riff+": "+riffs[riff][0]);
    riffData = riffs[riff][1];
    MIDI.allNotesOff();
 }

function ProcessMIDI()
 {
    var musicInfo = GetTimingInfo();

    if (musicInfo.playing)
     {
        var blockStartBeat = musicInfo.blockStartBeat;
        var blockEndBeat = musicInfo.blockEndBeat;
        var riffStart = blockStartBeat - (blockStartBeat % 32);
        var length = riffData.length;
        var i = 0;
        for (i; i < length; i++)
         {
            var data = riffData[i];
            var pos = data[3] + riffStart;
            // its before the process block
            if (pos < blockStartBeat)
             {
                continue;
             }
            // its after the process block
            if (pos > blockEndBeat)
             {
                break;
             }
            //Trace("["+data[0]+","+data[1]+","+data[2]+","+data[3]+","+data[4]+"] ");
            if (data[0] == 1)
             {
                note = new NoteOn();
             }
            else
             {
                note = new NoteOff();
             }
            note.pitch = data[1];
            note.velocity = data[2];
            note.articulationID = data[4];
            note.sendAtBeat(pos);

            // no more riff events but might still be processing so begin next riff
            if (i + 1 >= length)
             {
                riffStart+= 32;
                i = 0;
             }
         }
     }
 }

//define the UI -----------------------------------------------------------------

var PluginParameters = [];

// add select riff control
PluginParameters.push(
 {
    name: "Riff",
    type: "menu",
    valueStrings: [
        riffs[0][0],
        riffs[1][0]
    ],
    defaultValue: 0
 });

The scripter plugin was loaded on a drum kit software instrument channel and works great for the most part.

I've traced each beat with another scripter plugin and all the notes have been logged, so i assume they've all been sent properly. All the notes should be there but they just can't be heard.

I've tried all kinds of things, i'm stuck!


问:
No rgl window pop up when using R in VScode in Linux
I am using VSCode remote extension to access my university HPC (high performance computing system) through ssh and run R in miniconda virtual environment in the HPC Linux sysmtem.

Using the following code in rgl package, there should be a new pop-up window which allows me to freely rotate the 3D objects:

```<code>library(rgl)
vertices <- c(
     -1.0, -1.0, 0,
      1.0, -1.0, 0,
      1.0,  1.0, 0,
     -1.0,  1.0, 0
  )
  indices <- c( 1, 2, 3, 4 )

  open3d()
  wire3d( mesh3d(vertices = vertices, quads = indices) )
</code>```

However, when I run R in VSCode, no such pop-up window appears! I am not sure why this is the case and if there is a solution.

Body:
I am using VSCode remote extension to access my university HPC (high performance computing system) through ssh and run R in miniconda virtual environment in the HPC Linux sysmtem.

Using the following code in rgl package, there should be a new pop-up window which allows me to freely rotate the 3D objects:

library(rgl)
vertices <- c(
     -1.0, -1.0, 0,
      1.0, -1.0, 0,
      1.0,  1.0, 0,
     -1.0,  1.0, 0
  )
  indices <- c( 1, 2, 3, 4 )

  open3d()
  wire3d( mesh3d(vertices = vertices, quads = indices) )

However, when I run R in VSCode, no such pop-up window appears! I am not sure why this is the case and if there is a solution.


问:
client.UploadFile with FTP is not working
Thanks in Advance.

Code is written to send a single file from windows server to printer. Printer is installed on windows server & able to give test print from notepad/WordPad. Addition to this, from windows server when I try to ping the printer IP address, I am able to ping the same. With this I already ensured that printer & windows server is able to make communication with each other.

Code:

```<code>try{
    using (var client = new System.Net.WebClient())
{
    client.UploadFile("ftp://Printer IP/B1C_Data_XML92795.xml", System.Net.WebRequestMethods.Ftp.UploadFile, @"\\Server IP\LabelFiles\B1C_Data_XML92795.xml");
}
}
catch(Exception ex)
{
    errormessage = ex.Message;
    errorstacktrace = ex.StackTrace;
}

</code>```

This code is working on Windows Server A. When I moved this entire solution to Server B, on Server B, I am getting an below error:

errormessage
System error.

errorstacktrace
at System.Net.WebClient.UploadFile(Uri address, String method, String fileName) at Class_84780c95075c7d0edb28c9131871f01b._Execute_ed0d3090e0ce469ead03fea36f5fd832()

I am not able to point what is the exact cause of this problem. Requesting you to please help me to solve this problem.

I already tried to to perform FTP from both the servers & it is working fine. For this, I opened CMD & typed below command

C:\Windows\system32>ftp Printer IP
Connected to Printer IP.
220 ABR-79071 Version V75.20.14Z ready.

I already tried with

CMD commands

PING result

C drive to D drive file movement. But D drive to printer movement is not working on Server B. It is working on Server A. Both Servers A & B are identical. Only IP & hostnames are different.

I am expecting that someone will help me to solve this problem.

Body:
Thanks in Advance.

Code is written to send a single file from windows server to printer. Printer is installed on windows server & able to give test print from notepad/WordPad. Addition to this, from windows server when I try to ping the printer IP address, I am able to ping the same. With this I already ensured that printer & windows server is able to make communication with each other.

Code:

try{
    using (var client = new System.Net.WebClient())
{
    client.UploadFile("ftp://Printer IP/B1C_Data_XML92795.xml", System.Net.WebRequestMethods.Ftp.UploadFile, @"\\Server IP\LabelFiles\B1C_Data_XML92795.xml");
}
}
catch(Exception ex)
{
    errormessage = ex.Message;
    errorstacktrace = ex.StackTrace;
}

This code is working on Windows Server A. When I moved this entire solution to Server B, on Server B, I am getting an below error:

errormessage
System error.

errorstacktrace
at System.Net.WebClient.UploadFile(Uri address, String method, String fileName) at Class_84780c95075c7d0edb28c9131871f01b._Execute_ed0d3090e0ce469ead03fea36f5fd832()

I am not able to point what is the exact cause of this problem. Requesting you to please help me to solve this problem.

I already tried to to perform FTP from both the servers & it is working fine. For this, I opened CMD & typed below command

C:\Windows\system32>ftp Printer IP
Connected to Printer IP.
220 ABR-79071 Version V75.20.14Z ready.

I already tried with

CMD commands

PING result

C drive to D drive file movement. But D drive to printer movement is not working on Server B. It is working on Server A. Both Servers A & B are identical. Only IP & hostnames are different.

I am expecting that someone will help me to solve this problem.


问:
Barcode reader issue
right now I am using a barcode reader connected to the computer via usb. The reader in question is an optic one of the brand Alberici, model LT-B001-0010.

I use this reader to scan health cards (ehic), and I would need to save the scan image and save the barcode string.

My problem comes from the fact that the reader in question is not sold with its own software for use and therefore I can not use it as I would like.

I tried to use a couple of software but they were either not functional or were not compatible with the barcode reader.

Although it should simulate a keyboard, the situation is a bit ambiguous because if I open the notepad and scan the ehic the barcode reader does not automatically write it to the text file.

Does anyone have any advice on how I should move? A software that could help me, lines of code, it’s all right as long as it’s functional.

Thank you

R.B.

Title: Barcode reader issue


问:
How to set battery threshold using tlp
I can't figure out how to set up tlp battery threshold, I don't understand their website instructions.

Tlp says my laptop supports battery threshold, If anyone can guide me how to set it up thanks.
Also tlp seem to function directly on terminal.

Title: How to set battery threshold using tlp


问:
Is there a way to make a screenshot to the console using Selenium WebDriver?
I am trying to make a screenshot to the DevTools console when my automated test fails to see which errors occur. Is there any way to achieve this?

I am only thinking at using Keys in order to simulate pressing the F12 key but I was wondering if there is a better way.

What the screenshot should look like is presented in the image below:

I want to basically see these errors.

Thanks!


问:
Is there any tool in Flutter that allows you to perform any function only on the selected day, month, year and time?
I'm developing an application in Flutter for online queries and right now I'm lost as to how to show the user, for example, a message based on the exact time he previously chose. The user can already choose the day, month, year and time, and after he selects them, I can store them as Strings, but I don't know of any tool that can perform some function at that exact moment. What I want to do is that after entering the information of the day and time of the consultation, a notification appears to the user asking him if he wants to join the video call, but only at the time he chose.

I tried to calculate the difference between the chosen date and the current moment, and based on that duration I used the Timer to execute some task after the elapsed time. But I was also in doubt if this function would be executed even if the user had not opened the application, so I don't know if it would really work or not. Previously I also researched dependencies that could help, I found for example the sf_calendar, but from what I observed it only has a system to choose the date and save and display this data on the screen, but it does not allow performing some function on that date.


问:
Exposing bookstack with ngrok
My ngrok connection resolve the address of my bookstack pages with the localhost.

When I expose my container running on the linux machine with this command:

```<code>ngrok http 8080
</code>```

ngrok returns the link with the local ip address instead with the ngrok link.

Inside my .env the APP_URL is:

```<code>APP_URL= http://my_local_ip_address:8080  (not "localhost")
</code>```

But if I take the generated ip from ngrok and I substitute with the local ip parts of the link it works.

Title: Exposing bookstack with ngrok

Body:
My ngrok connection resolve the address of my bookstack pages with the localhost.

When I expose my container running on the linux machine with this command:

ngrok http 8080

ngrok returns the link with the local ip address instead with the ngrok link.

Inside my .env the APP_URL is:

APP_URL= http://my_local_ip_address:8080  (not "localhost")

But if I take the generated ip from ngrok and I substitute with the local ip parts of the link it works.


问:
Write isolated Cypress tests
I have a multiple services project which is deployed into kubernetes clusters. Currently we're trying to cover our frontend with Cypress tests. We're executing tests on our CI pipeline in Azure DEVOPS.

The main problem is to keep tests flow consistent as every test is able to change the test data. The ideal solution (what I see) would be to make them isolated by resetting database (loading data from dump) between test suites or even single tests. It works fine locally however in CI env seems to be not feasible - it also needs to reset cache (redis and memcached) and loading dump itself takes several minutes per time.

Would love if you can share your best experience and thoughts about that.
Thanks in advance!

Title: Write isolated Cypress tests


问:
wordpress json API fetch problem from localhost
if I call the json api v2 in wordpress from a local website via fetch, it works without any problems.

```<code>fetch('https://example.com/wp-json/wp/v2/pages/', { method: 'GET', headers: { 'content-type': 'application/json' } } )
</code>```

when I call the old json api via fetch I get an error unable to fetch (directly with the browser no problem)

```<code>fetch('https://example.com/?json=get_page_index&custom_fields=*&dev=1&count=800', { method: 'GET', headers: { 'content-type': 'plain/text' } } )
</code>```

in the network debug tab I see
provisional headers are shown Learn more
application/json: application/json
DNT: 1
Referrer: http://localhost:8080/
User-Agent: Mozilla/5.0 (iPad; CPU OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/87.0.4280.7

What could be the reason.

Body:
if I call the json api v2 in wordpress from a local website via fetch, it works without any problems.

fetch('https://example.com/wp-json/wp/v2/pages/', { method: 'GET', headers: { 'content-type': 'application/json' } } )

when I call the old json api via fetch I get an error unable to fetch (directly with the browser no problem)

fetch('https://example.com/?json=get_page_index&custom_fields=*&dev=1&count=800', { method: 'GET', headers: { 'content-type': 'plain/text' } } )

in the network debug tab I see
provisional headers are shown Learn more
application/json: application/json
DNT: 1
Referrer: http://localhost:8080/
User-Agent: Mozilla/5.0 (iPad; CPU OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/87.0.4280.7

What could be the reason.


问:
zod localisation of messages for err
As everyone is aware the npm package zod is awesome for validation/parsing.
It would be great if the error messages can be translated to another language as english?
Did anyone try to use localisation on ZOD?</p>

Title: zod localisation of messages for err


问:
Heroku bundler update removes installed gem and causes my app deploy to fail compile
I have a running ROR Heroku app and I upload code changes regularly. in my recent upload, Heroku changed their bundler version from 2.3.10 to 2.3.25 and now my app deployment fails on compile because one of the gems is removed in the Heroku process...
I only did minor changes in css so I'm sure the reason is not caused by code changes...
no changes were done in gemfile and gemfile.lock as well.

the app compiles and runs with no problems on local dev machine.

you can see in the attached images the changes between the logs of the last successful deploy and the recent failed one. it looks like for some reason the new bundler is removing mini_portile2 (2.6.1) and this causes my compile to fail because some other gem is dependent on it.

mini_portile2 (2.6.1) appears in gemfile and gemfile.lock so I cannot understand why it is removed.

Log of the last successful deploy:
Log compare 1

```<code>-----> Using buildpack: heroku/ruby
-----> Ruby app detected
-----> Installing bundler 2.3.10
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.7.1
-----> Installing dependencies using bundler 2.3.10
       Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
       Using rake 13.0.6
       Using concurrent-ruby 1.1.9
       Using i18n 1.8.10
       Using minitest 5.14.4
       Using tzinfo 2.0.4
       Using zeitwerk 2.4.2
       Using activesupport 6.1.3.2
       Using builder 3.2.4
       Using erubi 1.10.0
       Using mini_portile2 2.6.1
       Using racc 1.5.2
       .....
       Bundle complete! 39 Gemfile dependencies, 132 gems now installed.
       Gems in the groups 'development' and 'test' were not installed.
       Bundled gems are installed into `./vendor/bundle`
       Bundle completed (0.88s)
       Cleaning up the bundler cache.
-----> Installing node-v16.13.1-linux-x64
-----> Installing yarn-v1.22.17
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
</code>```

Log of the recent failed deploy:
Log compare 2

```<code>-----> Building on the Heroku-18 stack
remote: -----> Using buildpack: heroku/ruby
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.3.25
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote:
remote: ###### WARNING:
remote:
remote:        Your app was upgraded to bundler 2.3.25.
remote:        Previously you had a successful deploy with bundler 2.3.10.
remote:
remote:        If you see problems related to the bundler version please refer to:
remote:        https://devcenter.heroku.com/articles/bundler-version#known-upgrade-issues
remote:
remote:
remote: -----> Using Ruby version: ruby-2.7.1
remote: -----> Installing dependencies using bundler 2.3.25
remote:        Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote:        Using rake 13.0.6
remote:        Using concurrent-ruby 1.1.9
remote:        Using i18n 1.8.10
remote:        Using minitest 5.14.4
remote:        Using tzinfo 2.0.4
remote:        Using zeitwerk 2.4.2
remote:        Using activesupport 6.1.3.2
remote:        Using builder 3.2.4
remote:        Using erubi 1.10.0
remote:        Using racc 1.5.2
               .....
remote:        Bundle complete! 39 Gemfile dependencies, 131 gems now installed.
remote:        Gems in the groups 'development' and 'test' were not installed.
remote:        Bundled gems are installed into `./vendor/bundle`
remote:        Bundle completed (0.69s)
remote:        Cleaning up the bundler cache.
remote:        Removing bundler (2.3.10)
remote:        Removing mini_portile2 (2.6.1)
remote: -----> Installing node-v16.18.1-linux-x64
remote: -----> Installing yarn-v1.22.19
remote: -----> Detecting rake tasks
remote:
remote:  !
remote:  !     Could not detect rake tasks
remote:  !     ensure you can run `$ bundle exec rake -P` against your app
remote:  !     and using the production group of your Gemfile.
remote:  !     /tmp/build_5db96fd8/vendor/ruby-2.7.1/lib/ruby/2.7.0/bundler/spec_set.rb:86:in `block in materialize': Could not find mini_portile2-2.7.0 in any of the sources (Bundler::GemNotFound)
</code>```

I have tried deleting gemfile.lock and re-creating it.
I have tried changing the version of mini_portile2 to a newer version ... I keep getting the same failed log file.
I'll really appreciate any help to fix this issue.

Body:
I have a running ROR Heroku app and I upload code changes regularly. in my recent upload, Heroku changed their bundler version from 2.3.10 to 2.3.25 and now my app deployment fails on compile because one of the gems is removed in the Heroku process...
I only did minor changes in css so I'm sure the reason is not caused by code changes...
no changes were done in gemfile and gemfile.lock as well.

the app compiles and runs with no problems on local dev machine.

you can see in the attached images the changes between the logs of the last successful deploy and the recent failed one. it looks like for some reason the new bundler is removing mini_portile2 (2.6.1) and this causes my compile to fail because some other gem is dependent on it.

mini_portile2 (2.6.1) appears in gemfile and gemfile.lock so I cannot understand why it is removed.

Log of the last successful deploy:
Log compare 1

-----> Using buildpack: heroku/ruby
-----> Ruby app detected
-----> Installing bundler 2.3.10
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.7.1
-----> Installing dependencies using bundler 2.3.10
       Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
       Using rake 13.0.6
       Using concurrent-ruby 1.1.9
       Using i18n 1.8.10
       Using minitest 5.14.4
       Using tzinfo 2.0.4
       Using zeitwerk 2.4.2
       Using activesupport 6.1.3.2
       Using builder 3.2.4
       Using erubi 1.10.0
       Using mini_portile2 2.6.1
       Using racc 1.5.2
       .....
       Bundle complete! 39 Gemfile dependencies, 132 gems now installed.
       Gems in the groups 'development' and 'test' were not installed.
       Bundled gems are installed into `./vendor/bundle`
       Bundle completed (0.88s)
       Cleaning up the bundler cache.
-----> Installing node-v16.13.1-linux-x64
-----> Installing yarn-v1.22.17
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile

Log of the recent failed deploy:
Log compare 2

-----> Building on the Heroku-18 stack
remote: -----> Using buildpack: heroku/ruby
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.3.25
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote:
remote: ###### WARNING:
remote:
remote:        Your app was upgraded to bundler 2.3.25.
remote:        Previously you had a successful deploy with bundler 2.3.10.
remote:
remote:        If you see problems related to the bundler version please refer to:
remote:        https://devcenter.heroku.com/articles/bundler-version#known-upgrade-issues
remote:
remote:
remote: -----> Using Ruby version: ruby-2.7.1
remote: -----> Installing dependencies using bundler 2.3.25
remote:        Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote:        Using rake 13.0.6
remote:        Using concurrent-ruby 1.1.9
remote:        Using i18n 1.8.10
remote:        Using minitest 5.14.4
remote:        Using tzinfo 2.0.4
remote:        Using zeitwerk 2.4.2
remote:        Using activesupport 6.1.3.2
remote:        Using builder 3.2.4
remote:        Using erubi 1.10.0
remote:        Using racc 1.5.2
               .....
remote:        Bundle complete! 39 Gemfile dependencies, 131 gems now installed.
remote:        Gems in the groups 'development' and 'test' were not installed.
remote:        Bundled gems are installed into `./vendor/bundle`
remote:        Bundle completed (0.69s)
remote:        Cleaning up the bundler cache.
remote:        Removing bundler (2.3.10)
remote:        Removing mini_portile2 (2.6.1)
remote: -----> Installing node-v16.18.1-linux-x64
remote: -----> Installing yarn-v1.22.19
remote: -----> Detecting rake tasks
remote:
remote:  !
remote:  !     Could not detect rake tasks
remote:  !     ensure you can run `$ bundle exec rake -P` against your app
remote:  !     and using the production group of your Gemfile.
remote:  !     /tmp/build_5db96fd8/vendor/ruby-2.7.1/lib/ruby/2.7.0/bundler/spec_set.rb:86:in `block in materialize': Could not find mini_portile2-2.7.0 in any of the sources (Bundler::GemNotFound)

I have tried deleting gemfile.lock and re-creating it.
I have tried changing the version of mini_portile2 to a newer version ... I keep getting the same failed log file.
I'll really appreciate any help to fix this issue.


问:
Type of 'this' is inferred at build time but not at editing time
In the following TypeScript code, the type of me is properly inferred at build time and thus me.text=num induces the error Type 'number' is not assignable to type 'string'.

```<code>function foo(): void
{
    let x = {
        text: <string>null,
        setValue: function(num: number): void
        {
            let me = this;
            me.text = num; // expected to raise error
        }
    };
}
</code>```

But at editing time, intellisense reports no error.

It happens in Visual Studio 2019.
Here is the tsconfig :

```<code>"compilerOptions":
{
    "target": "ES2015",
    "lib": [ "DOM", "ES6", "DOM.Iterable", "ScriptHost", "ES2017.String", "ES2018.AsyncIterable" ],
    "module": "none",
    "noImplicitAny": false,
    "noImplicitThis": true,
    "alwaysStrict": false,
    "strictNullChecks": false,
    "strictFunctionTypes": false
    ...
}
"typeAcquisition":
{
    "enable": false
    ...
}
</code>```

Body:
In the following TypeScript code, the type of me is properly inferred at build time and thus me.text=num induces the error Type 'number' is not assignable to type 'string'.

function foo(): void
{
    let x = {
        text: <string>null,
        setValue: function(num: number): void
        {
            let me = this;
            me.text = num; // expected to raise error
        }
    };
}

But at editing time, intellisense reports no error.

It happens in Visual Studio 2019.
Here is the tsconfig :

"compilerOptions":
{
    "target": "ES2015",
    "lib": [ "DOM", "ES6", "DOM.Iterable", "ScriptHost", "ES2017.String", "ES2018.AsyncIterable" ],
    "module": "none",
    "noImplicitAny": false,
    "noImplicitThis": true,
    "alwaysStrict": false,
    "strictNullChecks": false,
    "strictFunctionTypes": false
    ...
}
"typeAcquisition":
{
    "enable": false
    ...
}


问:
New to coding, trying to swap two fields with generics and apperently don't understand generics
i am trying to code a game from scratch, I have multiple types of buttons, one of those types has to switch the sprites it uses after it gets clicked. all buttons have one set of sprites, but that specific type has an extra field with the second set of sprites.

I have a solution that works, but was trying to us generics to swap the images instead (trying to learn something new). I think i don't understand generics, because the way i did it does nothing.

```<code>public class Button {
     protected BufferedImage[] imgs;
}

public class SpecialButton extends Button{

    private BufferedImage[] imgs2;

    public void swapImage() {
        //this works the way it was intended
        BufferedImage[] tmp = imgs;
        imgs = imgs2;
        imgs2 = tmp;
    }

    public void swapImageDoesNothing() {
        // this does nothing
        swap(imgs, imgs2);
    }

    public static <T> void swap(T obj1, T obj2){
        T tmp = obj1;
        obj1 = obj2;
        obj2 = tmp;
    }
}

</code>```

I tried multiple thing, also tried making the swap() method not static, but the goal was to have the static in another Utils class for other classes to use, don't know if i need it anywhere else, but i was trying to learn something about generics

```<code>public final class Utilities {

    private Utilities(){}

    public static <T> void swap(T obj1, T obj2){
        T tmp = obj1;
        obj1 = obj2;
        obj2 = tmp;
    }
}
</code>```

Body:
i am trying to code a game from scratch, I have multiple types of buttons, one of those types has to switch the sprites it uses after it gets clicked. all buttons have one set of sprites, but that specific type has an extra field with the second set of sprites.

I have a solution that works, but was trying to us generics to swap the images instead (trying to learn something new). I think i don't understand generics, because the way i did it does nothing.

public class Button {
     protected BufferedImage[] imgs;
}

public class SpecialButton extends Button{

    private BufferedImage[] imgs2;

    public void swapImage() {
        //this works the way it was intended
        BufferedImage[] tmp = imgs;
        imgs = imgs2;
        imgs2 = tmp;
    }

    public void swapImageDoesNothing() {
        // this does nothing
        swap(imgs, imgs2);
    }

    public static <T> void swap(T obj1, T obj2){
        T tmp = obj1;
        obj1 = obj2;
        obj2 = tmp;
    }
}

I tried multiple thing, also tried making the swap() method not static, but the goal was to have the static in another Utils class for other classes to use, don't know if i need it anywhere else, but i was trying to learn something about generics

public final class Utilities {

    private Utilities(){}

    public static <T> void swap(T obj1, T obj2){
        T tmp = obj1;
        obj1 = obj2;
        obj2 = tmp;
    }
}


问:
Azure B2C MFA after Sign in, don't enter email or phone a 2nd time?
I am trying to basically duplicate this flow from Microsoft...

The only difference is that I am doing it with Send Grid.

So my issue is this. The user logs in, and after they log in I want them to MFA with their email.

I don't want the user to enter their email again to send the code.. I already have that from the log in sitting in a claims bag.

When using Send Grid the examples show everything going into a display claim.

Here is the Technical Profile that calls the display claim.

```<code> <!--OTP Begin-->
        <TechnicalProfile Id="OTPUsingEmailAddress">
        <DisplayName>OTP using email address</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <Metadata>
            <Item Key="IpAddressClaimReferenceId">IpAddress</Item>
            <Item Key="ContentDefinitionReferenceId">api.localaccountpasswordreset</Item>
            <Item Key="UserMessageIfClaimsTransformationBooleanValueIsNotEqual">Your account has been locked. Contact your support person to unlock it, then try again.</Item>
          </Metadata>
          <CryptographicKeys>
            <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
          </CryptographicKeys>
          <IncludeInSso>false</IncludeInSso>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="signInNames.emailAddress" />
          </InputClaims>
            <DisplayClaims>
              <DisplayClaim DisplayControlReferenceId="OTPEmailVerificationControl" />
            </DisplayClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="signInNames.emailAddress" PartnerClaimType="Verified.Email" Required="true" />
            <OutputClaim ClaimTypeReferenceId="objectId" />
            <OutputClaim ClaimTypeReferenceId="userPrincipalName" />
            <OutputClaim ClaimTypeReferenceId="authenticationSource" />
          </OutputClaims>
          <ValidationTechnicalProfiles>
            <ValidationTechnicalProfile ReferenceId="AAD-UserReadUsingEmailAddress" />
          </ValidationTechnicalProfiles>
        </TechnicalProfile>
</code>```

So this is basically the documented process for send grid. Create a display control reference ID that does generates etc...

It basically looks like the picture above where it talks about sending an email to the email address and it will display the email address in the template using a claims transformation and then puts it in localization. All works great.

But..

If I remove the email address claims from the display controller above, after you hit send code it crashes.
If I leave in the email address it works and everything is good.
I really don't want to leave the email address display claim there because it is editable, and the user can change it even if its on accident.

Is there any way to get this flow to work without having to enter the email a 2nd time?

In my case using the Send Grid flow as demoed here.

```<code><DisplayControl Id="OTPEmailVerificationControl" UserInterfaceControlType="VerificationControl">
                <DisplayClaims>
                    <!--<DisplayClaim ClaimTypeReferenceId="signInNames.emailAddress" Required="true" />-->
                    <DisplayClaim ClaimTypeReferenceId="verificationCode" ControlClaimType="VerificationCode" Required="true" />
                </DisplayClaims>
                <Actions>
                    <Action Id="SendCode">
                        <ValidationClaimsExchange>
                            <ValidationClaimsExchangeTechnicalProfile TechnicalProfileReferenceId="GenerateOtp" />
                            <ValidationClaimsExchangeTechnicalProfile TechnicalProfileReferenceId="SendOtp">
                                <Preconditions>
                                    <Precondition Type="ClaimsExist" ExecuteActionsIf="false">
                                        <Value>objectId</Value>
                                        <Action>SkipThisValidationTechnicalProfile</Action>
                                    </Precondition>
                                </Preconditions>
                            </ValidationClaimsExchangeTechnicalProfile>
                        </ValidationClaimsExchange>
                    </Action>

                    <Action Id="VerifyCode">
                        <ValidationClaimsExchange>
                            <ValidationClaimsExchangeTechnicalProfile TechnicalProfileReferenceId="VerifyOtp" />
                        </ValidationClaimsExchange>
                    </Action>
                </Actions>
            </DisplayControl>
</code>```

Body:
I am trying to basically duplicate this flow from Microsoft...

The only difference is that I am doing it with Send Grid.

So my issue is this. The user logs in, and after they log in I want them to MFA with their email.

I don't want the user to enter their email again to send the code.. I already have that from the log in sitting in a claims bag.

When using Send Grid the examples show everything going into a display claim.

Here is the Technical Profile that calls the display claim.

        <TechnicalProfile Id="OTPUsingEmailAddress">
        <DisplayName>OTP using email address</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <Metadata>
            <Item Key="IpAddressClaimReferenceId">IpAddress</Item>
            <Item Key="ContentDefinitionReferenceId">api.localaccountpasswordreset</Item>
            <Item Key="UserMessageIfClaimsTransformationBooleanValueIsNotEqual">Your account has been locked. Contact your support person to unlock it, then try again.</Item>
          </Metadata>
          <CryptographicKeys>
            <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
          </CryptographicKeys>
          <IncludeInSso>false</IncludeInSso>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="signInNames.emailAddress" />
          </InputClaims>
            <DisplayClaims>
              <DisplayClaim DisplayControlReferenceId="OTPEmailVerificationControl" />
            </DisplayClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="signInNames.emailAddress" PartnerClaimType="Verified.Email" Required="true" />
            <OutputClaim ClaimTypeReferenceId="objectId" />
            <OutputClaim ClaimTypeReferenceId="userPrincipalName" />
            <OutputClaim ClaimTypeReferenceId="authenticationSource" />
          </OutputClaims>
          <ValidationTechnicalProfiles>
            <ValidationTechnicalProfile ReferenceId="AAD-UserReadUsingEmailAddress" />
          </ValidationTechnicalProfiles>
        </TechnicalProfile>

So this is basically the documented process for send grid. Create a display control reference ID that does generates etc...

It basically looks like the picture above where it talks about sending an email to the email address and it will display the email address in the template using a claims transformation and then puts it in localization. All works great.

But..

If I remove the email address claims from the display controller above, after you hit send code it crashes.
If I leave in the email address it works and everything is good.
I really don't want to leave the email address display claim there because it is editable, and the user can change it even if its on accident.

Is there any way to get this flow to work without having to enter the email a 2nd time?

In my case using the Send Grid flow as demoed here.

<DisplayControl Id="OTPEmailVerificationControl" UserInterfaceControlType="VerificationControl">
                <DisplayClaims>

                    <DisplayClaim ClaimTypeReferenceId="verificationCode" ControlClaimType="VerificationCode" Required="true" />
                </DisplayClaims>
                <Actions>
                    <Action Id="SendCode">
                        <ValidationClaimsExchange>
                            <ValidationClaimsExchangeTechnicalProfile TechnicalProfileReferenceId="GenerateOtp" />
                            <ValidationClaimsExchangeTechnicalProfile TechnicalProfileReferenceId="SendOtp">
                                <Preconditions>
                                    <Precondition Type="ClaimsExist" ExecuteActionsIf="false">
                                        <Value>objectId</Value>
                                        <Action>SkipThisValidationTechnicalProfile</Action>
                                    </Precondition>
                                </Preconditions>
                            </ValidationClaimsExchangeTechnicalProfile>
                        </ValidationClaimsExchange>
                    </Action>

                    <Action Id="VerifyCode">
                        <ValidationClaimsExchange>
                            <ValidationClaimsExchangeTechnicalProfile TechnicalProfileReferenceId="VerifyOtp" />
                        </ValidationClaimsExchange>
                    </Action>
                </Actions>
            </DisplayControl>


问:
Implementing a Guestbook for Gtihub Readme
I want to implement a Guestbook functionality for my main GitHub readme. So that visitors can leave comments about my account.

I created an issue called "Guestbook" and created a new GitHub workflow. The workflow will get triggered whenever some leaves a comment on the issue.

Workflow code:

```<code>name: Guestbook

on:
  issue_comment:
    types: [created]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Check if issue is guestbook
        if: github.event.issue.title == 'Guestbook'
        run: |
          # Extract all comments in the issue
          comments=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X GET "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments")

          # Update the README file with the comments
          echo "## Guestbook" > temp.md
          echo "" >> temp.md
          for comment in $(echo "$comments" | jq -r '.[] | @base64'); do
            _jq() {
            echo ${comment} | base64 --decode | jq -r ${1}
            }
            echo "- $(echo "$(_jq '.user.login')"): $(echo "$(_jq '.body')")" >> temp.md
          done

          # Append the guestbook section to the end of the README file
          cat README.md >> temp.md
          mv temp.md README.md

      - name: Commit and push changes
        uses: actions/git@v2
        with:
          repository: ${{ github.repository }}
          branch: master
          message: Update README with guestbook comments
          email: ${{ secrets.GITHUB_EMAIL }}
          username: ${{ secrets.GITHUB_USERNAME }}
          token: ${{ secrets.GITHUB_TOKEN }}
        run: |
          git add README.md
          git commit -m "Update README with guestbook comments"
          git push
</code>```

This is what I have tried until now. What happens is that I get an error like below:

What can I do about this?

Body:
I want to implement a Guestbook functionality for my main GitHub readme. So that visitors can leave comments about my account.

I created an issue called "Guestbook" and created a new GitHub workflow. The workflow will get triggered whenever some leaves a comment on the issue.

Workflow code:

name: Guestbook

on:
  issue_comment:
    types: [created]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Check if issue is guestbook
        if: github.event.issue.title == 'Guestbook'
        run: |
          # Extract all comments in the issue
          comments=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X GET "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments")

          # Update the README file with the comments
          echo "## Guestbook" > temp.md
          echo "" >> temp.md
          for comment in $(echo "$comments" | jq -r '.[] | @base64'); do
            _jq() {
            echo ${comment} | base64 --decode | jq -r ${1}
            }
            echo "- $(echo "$(_jq '.user.login')"): $(echo "$(_jq '.body')")" >> temp.md
          done

          # Append the guestbook section to the end of the README file
          cat README.md >> temp.md
          mv temp.md README.md

      - name: Commit and push changes
        uses: actions/git@v2
        with:
          repository: ${{ github.repository }}
          branch: master
          message: Update README with guestbook comments
          email: ${{ secrets.GITHUB_EMAIL }}
          username: ${{ secrets.GITHUB_USERNAME }}
          token: ${{ secrets.GITHUB_TOKEN }}
        run: |
          git add README.md
          git commit -m "Update README with guestbook comments"
          git push

This is what I have tried until now. What happens is that I get an error like below:

What can I do about this?


问:
quickbooks-api did not recognize attribute auth
I recently update may Django app which is connected to quickbooks to python 3.9.16.
Due to this change, I've an issue :
QuickBooks' object has no attribute 'auth_client':
My code is :

```<code>try:
    auth_client = AuthClient(
        client_id=CLIENT_ID,
        client_secret=CLIENT_SECRET,
        environment=ENV,
        redirect_uri=REDIRECT_URI,
        )

except Exception as exc:
    logging.info('log credentials SELECT Errors: {} - {}'.format(companyId, exc))
    chek = 'Nok'
# creating the client object to access the QBO account - if not able to connect, make 3 tries dans then stop
if chek != 'Nok':
    tries = 1
    logging.info('Trying to connect to QBO')
    for i in range(tries):
        try:
            client = QuickBooks(
                    auth_client=auth_client,
                    refresh_token=REFRESH_TOKEN,
                    company_id=COMPANY_ID,
                )

            # get the refresh token returned
            refresh_token_new = client.auth_client.refresh_token
</code>```

Error is on last lign. seems that it does not understand: client.auth_client

in requirements.txt I have (extract):
sqlalchemy
intuit-oauth
python-quickbooks
pandas
unidecode
gunicorn

without version infos.So should be last version

Body:
I recently update may Django app which is connected to quickbooks to python 3.9.16.
Due to this change, I've an issue :
QuickBooks' object has no attribute 'auth_client':
My code is :

try:
    auth_client = AuthClient(
        client_id=CLIENT_ID,
        client_secret=CLIENT_SECRET,
        environment=ENV,
        redirect_uri=REDIRECT_URI,
        )

except Exception as exc:
    logging.info('log credentials SELECT Errors: {} - {}'.format(companyId, exc))
    chek = 'Nok'
# creating the client object to access the QBO account - if not able to connect, make 3 tries dans then stop
if chek != 'Nok':
    tries = 1
    logging.info('Trying to connect to QBO')
    for i in range(tries):
        try:
            client = QuickBooks(
                    auth_client=auth_client,
                    refresh_token=REFRESH_TOKEN,
                    company_id=COMPANY_ID,
                )

            # get the refresh token returned
            refresh_token_new = client.auth_client.refresh_token

Error is on last lign. seems that it does not understand: client.auth_client

in requirements.txt I have (extract):
sqlalchemy
intuit-oauth
python-quickbooks
pandas
unidecode
gunicorn

without version infos.So should be last version


问:
Hashes not being the same when running the script twice(hash is not reproducable)
1.Hashes not being the same when running the script twice(hash is not reproducable)
2.Relevant functions are ZipFile(), ZipInfo.from_file, the ZipInfo object and ZipFile.writestr() are not working inmy script
3.Need to run the script twice and hash value rmain smae and rename the file as same</p>
```<code>
import os
import yaml
import hashlib
import zipfile

src=r"C:\user\test"
dst=r"C:\sample"

with zipfile.ZipFile('sample.zip', 'w') as f:
    for root, dirs, files in os.walk(dst, topdown=False):

        for name in files:
            filePath = os.path.join(root, name)
            realpath=os.path.relpath(filePath,src)
            f.write(filePath, realpath)

with open('sample.zip','rb') as f:`your text`
    bytes = f.read()
    checksum  = hashlib.sha256(bytes).hexdigest();
    print(checksum)

os.rename ("sample.zip",f"out_{checksum [:6]}.zip")

</code>```

Body:
1.Hashes not being the same when running the script twice(hash is not reproducable)
2.Relevant functions are ZipFile(), ZipInfo.from_file, the ZipInfo object and ZipFile.writestr() are not working inmy script
3.Need to run the script twice and hash value rmain smae and rename the file as same

import os
import yaml
import hashlib
import zipfile

src=r"C:\user\test"
dst=r"C:\sample"

with zipfile.ZipFile('sample.zip', 'w') as f:
    for root, dirs, files in os.walk(dst, topdown=False):

        for name in files:
            filePath = os.path.join(root, name)
            realpath=os.path.relpath(filePath,src)
            f.write(filePath, realpath)

with open('sample.zip','rb') as f:`your text`
    bytes = f.read()
    checksum  = hashlib.sha256(bytes).hexdigest();
    print(checksum)

os.rename ("sample.zip",f"out_{checksum [:6]}.zip")


问:
How to catch an Iframe redirect and get the origin url in the parent component
I have a modal that shows an iframe. This iframe have in the src an integration of a sign-app. When the user signs the document, the iframe is redirected to a customizable url. I want to catch this redirection and check if the src of the iframe is one in particular. If so, then I close the modal and redirect the whole page to next page.

The problem is that the iframe is redirected correctly and I have managed to capture this redirection, but I don't know how to access the information of the redirected iframe.

HTML

```<code><div class="container-signable">
    <iframe [src]="signable" style="height:calc(100vh - 164px);" height="100%" width="100%" (load)="checkSignatures($event)"></iframe>
</div>
</code>```

Angular component

```<code>openModal(){
    this.formModal.show();
    window.dispatchEvent(new CustomEvent('RootLoaded'));
    this.signableService.postSignableTemplate(dataObject)
      .subscribe((response) => {
        this.signable = response;
      });
  }

  checkSignatures(event: any) {
    console.log(event);
    if(this.router.url === "documentos-signados") {
      this.closeModal();
      this.router.navigateByUrl('/confirmacion-alquiler');
    }
  }
</code>```

Body:
I have a modal that shows an iframe. This iframe have in the src an integration of a sign-app. When the user signs the document, the iframe is redirected to a customizable url. I want to catch this redirection and check if the src of the iframe is one in particular. If so, then I close the modal and redirect the whole page to next page.

The problem is that the iframe is redirected correctly and I have managed to capture this redirection, but I don't know how to access the information of the redirected iframe.

HTML

Angular component

openModal(){
    this.formModal.show();
    window.dispatchEvent(new CustomEvent('RootLoaded'));
    this.signableService.postSignableTemplate(dataObject)
      .subscribe((response) => {
        this.signable = response;
      });
  }

  checkSignatures(event: any) {
    console.log(event);
    if(this.router.url === "documentos-signados") {
      this.closeModal();
      this.router.navigateByUrl('/confirmacion-alquiler');
    }
  }


问:
How to read Combo boxes Value from Excel using C# or asp.net c#?
How to read Combo boxes Value from Excel using C#?
Trying to read Excel combo box value in c# site. but not able to get it.
This the excel which contain dropdown so whatever selected value in dropdown that should fetch:

This one snap code which I have written but while running this code I am getting compilation error.

```<code>Microsoft.Office.Interop.Excel.DropDown allDropDowns = worksheet.DropDowns(Type.Missing);
</code>```

At this line look like this Type. Missing not the proper one.

Even here also getting one compiler error at .Item("1"):

```<code>Microsoft.Office.Interop.Excel.DropDown oneDropdown = allDropDowns.Item("1");
</code>```

This is the main error

Can't able to proceed with this.

This is full snap code:

```<code>Microsoft.Office.Interop.Excel.Application oXL = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel._Workbook oWB;
Microsoft.Office.Interop.Excel._Worksheet oSheet;
Microsoft.Office.Interop.Excel.Range oRng;

//Get a new workbook.
oWB = (Microsoft.Office.Interop.Excel._Workbook)(oXL.Workbooks.Open("D:\\testexcel.xls"));
//3rd Sheet
oSheet = (Microsoft.Office.Interop.Excel._Worksheet)oWB.Sheets.get_Item(1);

Microsoft.Office.Interop.Excel.DropDowns allDropDowns = oSheet.DropDowns(Type.Missing);
Microsoft.Office.Interop.Excel.DropDown oneDropdown = allDropDowns.Item("1");
string selectedText = oneDropdown.get_List(oneDropdown.ListIndex);
</code>```

Please any one can fix this issue.

As I have mention above issue trying to read selected dropdown value from excel.

Body:
How to read Combo boxes Value from Excel using C#?
Trying to read Excel combo box value in c# site. but not able to get it.
This the excel which contain dropdown so whatever selected value in dropdown that should fetch:

This one snap code which I have written but while running this code I am getting compilation error.

Microsoft.Office.Interop.Excel.DropDown allDropDowns = worksheet.DropDowns(Type.Missing);

At this line look like this Type. Missing not the proper one.

Even here also getting one compiler error at .Item("1"):

Microsoft.Office.Interop.Excel.DropDown oneDropdown = allDropDowns.Item("1");

This is the main error

Can't able to proceed with this.

This is full snap code:

Microsoft.Office.Interop.Excel.Application oXL = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel._Workbook oWB;
Microsoft.Office.Interop.Excel._Worksheet oSheet;
Microsoft.Office.Interop.Excel.Range oRng;

//Get a new workbook.
oWB = (Microsoft.Office.Interop.Excel._Workbook)(oXL.Workbooks.Open("D:\\testexcel.xls"));
//3rd Sheet
oSheet = (Microsoft.Office.Interop.Excel._Worksheet)oWB.Sheets.get_Item(1);

Microsoft.Office.Interop.Excel.DropDowns allDropDowns = oSheet.DropDowns(Type.Missing);
Microsoft.Office.Interop.Excel.DropDown oneDropdown = allDropDowns.Item("1");
string selectedText = oneDropdown.get_List(oneDropdown.ListIndex);

Please any one can fix this issue.

As I have mention above issue trying to read selected dropdown value from excel.


问:
Is it possible to get Maven Dependance form smallrye-fault-tolerance Tests?
I found a project with tests for smallrye-fault-tolerance
https://github.com/smallrye/smallrye-fault-tolerance/blob/main/testsuite/basic/pom.xml
However, I need help finding a maven repo for this.
I found a version for 2.0.5 only where is the performance is greater than 5.0 (based on the parent)</p>


问:
Google Analytics GA4 - How to see Line Graph of Views for a single URL (Page path)?
In Universal Analytics (UA) - it was possible to click: Behaviour > Site Content > All Pages

Then, you could select any page on your site, to see a line graph of that page.

(Example - I could click on my "Contact Us" page, and see back from January, the visitors each day, to see if certain months or days get more traffic.

Example Image of What Was Possible in UA

I have tried everything - and watched YouTube videos and guides - but I cannot find anyone who seems to have used this feature, or a solution to recreate this in GA4.

Did nobody want to see how single pages performed?

Thanks for any help.

I would like to be able to see the Views for a single page using Google Analytics GA4.

So I can look at "Contact Us" page, and see the number of views each day for a set amount of time


问:
Div overflow table not starts at same point
I have follwing layout Code:

```<code><app-navbar id="top-nav"></app-navbar>
<div  id="wrapper" >
        <div class="al-left">
            <app-side-nav [isExpanded]="sidebarExpanded" (toggleSidebar)="sidebarExpanded = !sidebarExpanded" > </app-side-nav>
        </div>

        <div class="al-right" id="content">
            <router-outlet></router-outlet>
        </div>

</div>
</code>```

CSS:

```<code>#top-nav {
    position: fixed;
    width: 100%;
    z-index: 99;

}
#wrapper{
    display: flex;

}
#content{
    overflow: scroll;
}

.al-left{
    position: relative;
    z-index: 100;
}
.al-right {
    flex-grow: 1;
}

.al-right{
    margin-left:20px;
    margin-right:20px;
    margin-top: 80px;

    max-width: 100% !important;
    width: 100% !important;
}
</code>```

Issue is I have a wide table with numbers of columns and when I am trying to apply overflow:auto, the column A,B,C is hidden behind the div, also x-scroll is even starts from column D as shown below img.

Current output:

I have two questions:

How can start table with div start?

How I can I fixed the size of content div that doesnt matter any size of contnt div will not chnage size?

Desire output:

Body:
I have follwing layout Code:

<app-navbar id="top-nav"></app-navbar>

            <app-side-nav [isExpanded]="sidebarExpanded" (toggleSidebar)="sidebarExpanded = !sidebarExpanded" > </app-side-nav>

            <router-outlet></router-outlet>

CSS:

#top-nav {
    position: fixed;
    width: 100%;
    z-index: 99;

}
#wrapper{
    display: flex;

}
#content{
    overflow: scroll;
}

.al-left{
    position: relative;
    z-index: 100;
}
.al-right {
    flex-grow: 1;
}

.al-right{
    margin-left:20px;
    margin-right:20px;
    margin-top: 80px;

    max-width: 100% !important;
    width: 100% !important;
}

Issue is I have a wide table with numbers of columns and when I am trying to apply overflow:auto, the column A,B,C is hidden behind the div, also x-scroll is even starts from column D as shown below img.

Current output:

I have two questions:

How can start table with div start?

How I can I fixed the size of content div that doesnt matter any size of contnt div will not chnage size?

Desire output:


问:
running django project on another pc
I am using mysql as the database of the django project, mysql is installed on the computer I will install, but after the migrate process on the other computer I installed, an error comes up and only django does its own migrate process, the models in my models.py files do not pass to the database.

```<code>?:(mysql.w002) MariaDB Strict Mode is not set for database connection 'default'
HINT: MariaDB's strict mode fixes many data intergity problems in mariadb, such as data truncation upon insertion,by escalating warnings into errors. It is strongly recommended you active it see: https://docs.djangoproject.com/en/ref/databases/mysql-sql-mode
</code>```

enter image description here

Title: running django project on another pc

Body:
I am using mysql as the database of the django project, mysql is installed on the computer I will install, but after the migrate process on the other computer I installed, an error comes up and only django does its own migrate process, the models in my models.py files do not pass to the database.

?:(mysql.w002) MariaDB Strict Mode is not set for database connection 'default'
HINT: MariaDB's strict mode fixes many data intergity problems in mariadb, such as data truncation upon insertion,by escalating warnings into errors. It is strongly recommended you active it see: https://docs.djangoproject.com/en/ref/databases/mysql-sql-mode

enter image description here


问:
Exception IllegalMonitorStateException for JPA in dbcp2/tomcat
I have a exception live only while gathering a JPA result:

```<code>03-Dec-2022 12:29:22.546 SEVERE [SMTP Server Worker (rm-2)] de.e_nexus.server.mail.DefaultSMTPServer$SMTPConnectionWorker$TransportSocket.<init> Created transport socket: a48fc8d5-8cf0-4c9f-88d2-201a47621987 using Socket[addr=/194.50.69.4,port=35600,localport=25]
Exception in thread "Thread-27" java.lang.IllegalMonitorStateException
    at java.base/java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:175)
    at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1007)
    at java.base/java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:494)
    at org.apache.tomcat.dbcp.pool2.impl.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:598)
    at org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:436)
    at org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:353)
    at org.apache.tomcat.dbcp.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:134)
    at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:753)
    at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
    at org.hibernate.internal.NonContextualJdbcConnectionAccess.obtainConnection(NonContextualJdbcConnectionAccess.java:38)
    at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:108)
    at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:138)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.connection(StatementPreparerImpl.java:50)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:149)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:176)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:151)
    at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:2103)
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2040)
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2018)
    at org.hibernate.loader.Loader.doQuery(Loader.java:948)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:349)
    at org.hibernate.loader.Loader.doList(Loader.java:2849)
    at org.hibernate.loader.Loader.doList(Loader.java:2831)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2663)
    at org.hibernate.loader.Loader.list(Loader.java:2658)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:506)
    at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400)
    at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219)
    at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1414)
    at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1625)
    at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1593)
    at org.hibernate.query.Query.getResultList(Query.java:165)
    at jdk.internal.reflect.GeneratedMethodAccessor4243.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:402)
    at jdk.proxy11/jdk.proxy11.$Proxy799.getResultList(Unknown Source)
    at de.e_nexus.web.rm.mail.veto.dnsbl.DNSBlackList.veto(DNSBlackList.java:39)
    at de.e_nexus.web.rm.mail.veto.dnsbl.DNSBlackList.veto(DNSBlackList.java:29)
    at de.e_nexus.utils.VetoCouncil$1.ask(VetoCouncil.java:87)
    at de.e_nexus.utils.VetoCouncil$1Survey.run(VetoCouncil.java:73)
</code>```

This is the class:

```<code>/*  ___     _
 * | _ \___| |___ __ _ ___ ___  Copyright 2016
 * |   / -_) / -_) _` (_-</ -_) https://www.e-nexus.de./
 * |_|_\___|_\___\__,_/__/\___| by Peter Rader   _
 * |  \/  |__ _ _ _  __ _ __ _ ___ _ __  ___ _ _| |_
 * | |\/| / _` | ' \/ _` / _` / -_) '  \/ -_) ' \  _|
 * |_|  |_\__,_|_||_\__,_\__, \___|_|_|_\___|_||_\__|
 * All rights reserved    |___/
 */
package de.e_nexus.web.rm.mail.veto.dnsbl;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.inject.Named;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.xbill.DNS.ARecord;
import org.xbill.DNS.Lookup;
import org.xbill.DNS.Record;
import org.xbill.DNS.Type;

import de.e_nexus.server.mail.AllowConnection;
import de.e_nexus.server.mail.VetoConnection;
import de.e_nexus.web.rm.entity.DNSBlacklistService;

@Named
public class DNSBlackList implements VetoConnection {

    @PersistenceContext
    private final EntityManager entityManager = null;
    public static final Logger LOG = Logger.getLogger(DNSBlackList.class.getCanonicalName());

    @Override
    public boolean veto(final AllowConnection plan) {
        List<DNSBlacklistService> blacklistServices = entityManager.createQuery("FROM " + DNSBlacklistService.class.getCanonicalName(), DNSBlacklistService.class)
                .getResultList(); // <-- this is line 39
        String hostName = plan.getIncommingIP().getHostName();
        LOG.finer("Ask for host: " + hostName);
        for (DNSBlacklistService dnsBlacklistService : blacklistServices) {
            try {
                String url = hostName + "." + dnsBlacklistService.getDomainName();
                LOG.fine("Ask url: " + url);
                Lookup lookup = new Lookup(url, Type.ANY);
                Record[] run = lookup.run();
                if (run != null) {
                    for (Record r : run) {
                        if (r instanceof ARecord) {
                            plan.setMessage("Your a spammer said " + dnsBlacklistService.getDomainName() + "!");
                            LOG.warning("Service " + dnsBlacklistService.getDomainName() + " said " + plan.getIncommingIP() + " is spammer!");
                            return true;
                        }
                    }
                }
            } catch (Exception e) {
                LOG.log(Level.INFO, "Cant ask DNSBL", e);
            }
        }
        return false;
    }
}
</code>```

JDK is:

```<code>/root/amazon-corretto-17.0.4.9.1-linux-x64/bin/java
</code>```

Tomcat is:

```<code>/usr/local/share/apache-tomcat-8.5.50/
</code>```

Hibernate is:

```<code>hibernate-core-5.4.28.Final.jar
hibernate-envers-5.4.28.Final.jar
</code>```

DB-Config is (xxx is replaced):

```<code><Resource name="jdbc/database" auth="Container"
 type="javax.sql.DataSource"
 driverClassName="org.postgresql.Driver" url="xxx"
 defaultAutoCommit="false" username="xxx" password="xxx"
 maxActive="400" maxTotal="500" maxIdle="5" maxWait="1"></Resource>
</code>```

Body:
I have a exception live only while gathering a JPA result:

03-Dec-2022 12:29:22.546 SEVERE [SMTP Server Worker (rm-2)] de.e_nexus.server.mail.DefaultSMTPServer$SMTPConnectionWorker$TransportSocket.<init> Created transport socket: a48fc8d5-8cf0-4c9f-88d2-201a47621987 using Socket[addr=/194.50.69.4,port=35600,localport=25]
Exception in thread "Thread-27" java.lang.IllegalMonitorStateException
    at java.base/java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(ReentrantLock.java:175)
    at java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer.release(AbstractQueuedSynchronizer.java:1007)
    at java.base/java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:494)
    at org.apache.tomcat.dbcp.pool2.impl.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:598)
    at org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:436)
    at org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:353)
    at org.apache.tomcat.dbcp.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:134)
    at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:753)
    at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
    at org.hibernate.internal.NonContextualJdbcConnectionAccess.obtainConnection(NonContextualJdbcConnectionAccess.java:38)
    at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:108)
    at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:138)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.connection(StatementPreparerImpl.java:50)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:149)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:176)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:151)
    at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:2103)
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2040)
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2018)
    at org.hibernate.loader.Loader.doQuery(Loader.java:948)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:349)
    at org.hibernate.loader.Loader.doList(Loader.java:2849)
    at org.hibernate.loader.Loader.doList(Loader.java:2831)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2663)
    at org.hibernate.loader.Loader.list(Loader.java:2658)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:506)
    at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400)
    at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219)
    at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1414)
    at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1625)
    at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1593)
    at org.hibernate.query.Query.getResultList(Query.java:165)
    at jdk.internal.reflect.GeneratedMethodAccessor4243.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:402)
    at jdk.proxy11/jdk.proxy11.$Proxy799.getResultList(Unknown Source)
    at de.e_nexus.web.rm.mail.veto.dnsbl.DNSBlackList.veto(DNSBlackList.java:39)
    at de.e_nexus.web.rm.mail.veto.dnsbl.DNSBlackList.veto(DNSBlackList.java:29)
    at de.e_nexus.utils.VetoCouncil$1.ask(VetoCouncil.java:87)
    at de.e_nexus.utils.VetoCouncil$1Survey.run(VetoCouncil.java:73)

This is the class:

/*  ___     _
 * | _ \___| |___ __ _ ___ ___  Copyright 2016
 * |   / -_) / -_) _` (_-</ -_) https://www.e-nexus.de./
 * |_|_\___|_\___\__,_/__/\___| by Peter Rader   _
 * |  \/  |__ _ _ _  __ _ __ _ ___ _ __  ___ _ _| |_
 * | |\/| / _` | ' \/ _` / _` / -_) '  \/ -_) ' \  _|
 * |_|  |_\__,_|_||_\__,_\__, \___|_|_|_\___|_||_\__|
 * All rights reserved    |___/
 */
package de.e_nexus.web.rm.mail.veto.dnsbl;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.inject.Named;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.xbill.DNS.ARecord;
import org.xbill.DNS.Lookup;
import org.xbill.DNS.Record;
import org.xbill.DNS.Type;

import de.e_nexus.server.mail.AllowConnection;
import de.e_nexus.server.mail.VetoConnection;
import de.e_nexus.web.rm.entity.DNSBlacklistService;

@Named
public class DNSBlackList implements VetoConnection {

    @PersistenceContext
    private final EntityManager entityManager = null;
    public static final Logger LOG = Logger.getLogger(DNSBlackList.class.getCanonicalName());

    @Override
    public boolean veto(final AllowConnection plan) {
        List<DNSBlacklistService> blacklistServices = entityManager.createQuery("FROM " + DNSBlacklistService.class.getCanonicalName(), DNSBlacklistService.class)
                .getResultList(); // <-- this is line 39
        String hostName = plan.getIncommingIP().getHostName();
        LOG.finer("Ask for host: " + hostName);
        for (DNSBlacklistService dnsBlacklistService : blacklistServices) {
            try {
                String url = hostName + "." + dnsBlacklistService.getDomainName();
                LOG.fine("Ask url: " + url);
                Lookup lookup = new Lookup(url, Type.ANY);
                Record[] run = lookup.run();
                if (run != null) {
                    for (Record r : run) {
                        if (r instanceof ARecord) {
                            plan.setMessage("Your a spammer said " + dnsBlacklistService.getDomainName() + "!");
                            LOG.warning("Service " + dnsBlacklistService.getDomainName() + " said " + plan.getIncommingIP() + " is spammer!");
                            return true;
                        }
                    }
                }
            } catch (Exception e) {
                LOG.log(Level.INFO, "Cant ask DNSBL", e);
            }
        }
        return false;
    }
}

JDK is:

/root/amazon-corretto-17.0.4.9.1-linux-x64/bin/java

Tomcat is:

/usr/local/share/apache-tomcat-8.5.50/

Hibernate is:

hibernate-core-5.4.28.Final.jar
hibernate-envers-5.4.28.Final.jar

DB-Config is (xxx is replaced):

<Resource name="jdbc/database" auth="Container"
 type="javax.sql.DataSource"
 driverClassName="org.postgresql.Driver" url="xxx"
 defaultAutoCommit="false" username="xxx" password="xxx"
 maxActive="400" maxTotal="500" maxIdle="5" maxWait="1"></Resource>