问:
How to dynamically display each list object from a new line in PyQT6
I can't find a way for handleMessage() to display list objects from a new line with adding them to QLabel or QLineEdit.

This is my first topic here, I immediately apologize if I framed it wrong

```<code>from PyQt6 import QtCore, QtGui, QtWidgets

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1500,200)
        MainWindow.setStyleSheet("background-color: #282828")

        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)

        self.search = QtWidgets.QLineEdit(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(32)
        self.search.setFont(font)
        self.search.setToolTipDuration(-3)
        self.search.setStyleSheet("background-color: #161a1e; color: white; border: 3px solid #161a1e")
        self.search.setObjectName("search")
        self.gridLayout.addWidget(self.search, 0, 0, 1, 4)

        self.pushButton = QtWidgets.QPushButton(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(32)
        self.pushButton.setFont(font)
        self.pushButton.setStyleSheet("background-color: #161a1e; color: white;")
        self.pushButton.setObjectName("pushButton")
        self.gridLayout.addWidget(self.pushButton, 0, 4, 1, 1)

        self.line_1 = QtWidgets.QFrame(self.centralwidget)
        self.line_1.setStyleSheet("")
        self.line_1.setObjectName("line_1")
        self.line_1.setFrameShape(QtWidgets.QFrame.Shape.HLine)
        self.line_1.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
        self.gridLayout.addWidget(self.line_1, 1, 0, 1, 5)

        self.marketLabel_1 = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.marketLabel_1.setFont(font)
        self.marketLabel_1.setStyleSheet("color: white")
        self.marketLabel_1.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.marketLabel_1.setFixedHeight(40)
        self.marketLabel_1.setObjectName("marketLabel_1")
        self.gridLayout.addWidget(self.marketLabel_1, 2, 0, 1, 1)

        self.marketLabel_2 = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.marketLabel_2.setFont(font)
        self.marketLabel_2.setStyleSheet("color: white")
        self.marketLabel_2.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.marketLabel_2.setFixedHeight(40)
        self.marketLabel_2.setObjectName("marketLabel_2")
        self.gridLayout.addWidget(self.marketLabel_2, 2, 1, 1, 1)

        self.marketLabel_3 = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.marketLabel_3.setFont(font)
        self.marketLabel_3.setStyleSheet("color: white")
        self.marketLabel_3.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)

        self.marketLabel_3.setFixedHeight(40)
        self.marketLabel_3.setObjectName("marketLabel_3")
        self.gridLayout.addWidget(self.marketLabel_3, 2, 2, 1, 1)

        self.marketLabel_4 = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.marketLabel_4.setFont(font)
        self.marketLabel_4.setStyleSheet("color: white")
        self.marketLabel_4.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.marketLabel_4.setFixedHeight(40)
        self.marketLabel_4.setObjectName("marketLabel_4")
        self.gridLayout.addWidget(self.marketLabel_4, 2, 3, 1, 1)

        self.line_2 = QtWidgets.QFrame(self.centralwidget)
        self.line_2.setStyleSheet("")
        self.line_2.setObjectName("line_2")
        self.line_2.setFrameShape(QtWidgets.QFrame.Shape.HLine)
        self.line_2.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
        self.gridLayout.addWidget(self.line_2, 3, 0, 1, 5)

        self.tradingPairs = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(26)
        self.tradingPairs.setFont(font)
        self.tradingPairs.setStyleSheet("color: white;")
        self.tradingPairs.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.tradingPairs.setFixedHeight(40)
        self.tradingPairs.setObjectName("tradingPairs")
        self.gridLayout.addWidget(self.tradingPairs, 4, 0, 1, 1)

        self.lastTradedPrice = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(26)
        self.lastTradedPrice.setFont(font)
        self.lastTradedPrice.setStyleSheet("color: white;")
        self.lastTradedPrice.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.lastTradedPrice.setObjectName("lastTradedPrice")
        self.gridLayout.addWidget(self.lastTradedPrice, 4, 1, 1, 1)

        self.percentageChange = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(26)
        self.percentageChange.setFont(font)
        self.percentageChange.setStyleSheet("color: white;")
        self.percentageChange.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.percentageChange.setObjectName("percentageChange")
        self.gridLayout.addWidget(self.percentageChange, 4, 2, 1, 1)

        self.turnover = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(26)
        self.turnover.setFont(font)
        self.turnover.setStyleSheet("color: white;")
        self.turnover.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.turnover.setObjectName("turnover")
        self.gridLayout.addWidget(self.turnover, 4, 3, 1, 1)

        self.line_3 = QtWidgets.QFrame(self.centralwidget)
        self.line_3.setStyleSheet("")
        self.line_3.setObjectName("line_3")
        self.line_3.setFrameShape(QtWidgets.QFrame.Shape.HLine)
        self.line_3.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
        self.gridLayout.addWidget(self.line_3, 1000, 0, 1, 4)

        self.notificationsLabel = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.notificationsLabel.setFont(font)
        self.notificationsLabel.setToolTipDuration(-3)
        self.notificationsLabel.setStyleSheet("color: white")
        self.notificationsLabel.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.notificationsLabel.setObjectName("notificationsLabel")
        self.gridLayout.addWidget(self.notificationsLabel, 1001, 0, 1, 5)

        self.line_4 = QtWidgets.QFrame(self.centralwidget)
        self.line_4.setStyleSheet("")
        self.line_4.setObjectName("line_5")
        self.line_4.setFrameShape(QtWidgets.QFrame.Shape.HLine)
        self.line_4.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
        self.gridLayout.addWidget(self.line_4, 1002, 0, 1,5)

        self.notificationsLabel_1 = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.notificationsLabel_1.setFont(font)
        self.notificationsLabel_1.setToolTipDuration(-3)
        self.notificationsLabel_1.setStyleSheet("color: white")
        self.notificationsLabel_1.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.notificationsLabel_1.setObjectName("notificationsLabel")
        self.gridLayout.addWidget(self.notificationsLabel_1, 1002, 0, 1, 1)

        self.notificationsLabel_2 = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.notificationsLabel_2.setFont(font)
        self.notificationsLabel_2.setToolTipDuration(-3)
        self.notificationsLabel_2.setStyleSheet("color: white")
        self.notificationsLabel_2.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.notificationsLabel_2.setObjectName("notificationsLabel")
        self.gridLayout.addWidget(self.notificationsLabel_2, 1002, 1, 1, 1)

        self.notificationsLabel_3 = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.notificationsLabel_3.setFont(font)
        self.notificationsLabel_3.setToolTipDuration(-3)
        self.notificationsLabel_3.setStyleSheet("color: white")
        self.notificationsLabel_3.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.notificationsLabel_3.setObjectName("notificationsLabel")
        self.gridLayout.addWidget(self.notificationsLabel_3, 1002, 2, 1, 1)

        self.notificationsLabel_4 = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.notificationsLabel_4.setFont(font)
        self.notificationsLabel_4.setToolTipDuration(-3)
        self.notificationsLabel_4.setStyleSheet("color: white")
        self.notificationsLabel_4.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.notificationsLabel_4.setObjectName("notificationsLabel")
        self.gridLayout.addWidget(self.notificationsLabel_4, 1002, 3, 1, 1)

        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.pushButton.setText(_translate("MainWindow", "найти"))
        self.marketLabel_1.setText(_translate("MainWindow", "Торговая пара"))
        self.marketLabel_2.setText(_translate("MainWindow", "Цена"))
        self.marketLabel_3.setText(_translate("MainWindow", "Изменения, %"))
        self.marketLabel_4.setText(_translate("MainWindow", "Объемы"))
        self.notificationsLabel.setText(_translate("MainWindow", "Уведомления"))
        self.notificationsLabel_1.setText(_translate("MainWindow", "Торговая пара"))
        self.notificationsLabel_2.setText(_translate("MainWindow", "Цена"))
        self.notificationsLabel_3.setText(_translate("MainWindow", "Изменения, %"))
        self.notificationsLabel_4.setText(_translate("MainWindow", "Дата и время"))

if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    MainWindow = QtWidgets.QMainWindow()
    ui = Ui_MainWindow()
    ui.setupUi(MainWindow)
    MainWindow.show()
    sys.exit(app.exec())
</code>```
```<code>import sys
import time
from datetime import datetime

from plyer import notification
from pybit import usdt_perpetual
from PyQt6 import QtCore, QtGui, QtWidgets

from programWindow import Ui_MainWindow

class HandleMessage(QtWidgets.QMainWindow):
    def __init__(self, *args, **kwds):
        super(HandleMessage, self).__init__()
        self.programWindow = Ui_MainWindow()
        self.programWindow.setupUi(self)
        self.display()
        self.connect()
        self.addNewLine()

    def display(self):
        self.programWindow.search.setPlaceholderText('Пример: btc, eth, doge')
        self.programWindow.pushButton.clicked.connect(self.addNewLine)

    def connect(self):
        symbol_list = ["BTCUSDT", "DOGEUSDT"]

        ws_linear = usdt_perpetual.WebSocket(
            test=False,
            ping_interval=3000,
            ping_timeout=2000,
            domain="bybit"
            )

        ws_linear.kline_stream(
            callback=self.handleMessage,
            symbol=symbol_list,
            interval="1"
            )

    def handleMessage(self, message):
        data = message['data'][0]
        open = data["open"]
        symbol = message["topic"][9:]
        close = data['close']
        turnover = '{0:,}'.format(int(float(data['turnover']))).replace(',', '.')
        priceChange = round((close/open-1)*100, 2)

        self.programWindow.lastTradedPrice.setText(str(close))
        self.programWindow.tradingPairs.setText(symbol)
        self.programWindow.percentageChange.setText(str(priceChange))
        self.programWindow.turnover.setText(str(turnover))

        if close > open:
            self.programWindow.lastTradedPrice.setStyleSheet("color: yellow;\nborder: 0")
            self.programWindow.percentageChange.setStyleSheet("color: yellow;\nborder: 0")
        elif close < open:
            self.programWindow.lastTradedPrice.setStyleSheet("color: red;\nborder: 0")
            self.programWindow.percentageChange.setStyleSheet("color: red;\nborder: 0")
        else:
            self.programWindow.lastTradedPrice.setStyleSheet("color: white;\nborder: 0")
            self.programWindow.percentageChange.setStyleSheet("color: white;\nborder: 0")

    def addNewLine(self):

        self.tradingPairs = QtWidgets.QLineEdit(self.programWindow.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(26)
        self.tradingPairs.setFont(font)
        self.tradingPairs.setStyleSheet("color: white;")
        self.tradingPairs.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.tradingPairs.setFixedHeight(40)
        self.tradingPairs.setObjectName("tradingPairs")

        self.lastTradedPrice = QtWidgets.QLineEdit(self.programWindow.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(26)
        self.lastTradedPrice.setFont(font)
        self.lastTradedPrice.setStyleSheet("color: white;")
        self.lastTradedPrice.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.lastTradedPrice.setObjectName("lastTradedPrice")

        self.percentageChange = QtWidgets.QLineEdit(self.programWindow.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(26)
        self.percentageChange.setFont(font)
        self.percentageChange.setStyleSheet("color: white;")
        self.percentageChange.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.percentageChange.setObjectName("percentageChange")

        self.turnover = QtWidgets.QLineEdit(self.programWindow.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(26)
        self.turnover.setFont(font)
        self.turnover.setStyleSheet("color: white;")
        self.turnover.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.turnover.setObjectName("turnover")

        row = self.programWindow.gridLayout.count()-12

        self.programWindow.gridLayout.addWidget(self.tradingPairs, row, 0, 1, 1)
        self.programWindow.gridLayout.addWidget(self.lastTradedPrice, row, 1, 1, 1)
        self.programWindow.gridLayout.addWidget(self.percentageChange, row, 2, 1, 1)
        self.programWindow.gridLayout.addWidget(self.turnover, row, 3, 1, 1)

app = QtWidgets.QApplication([])
application = HandleMessage()
application.show()
sys.exit(app.exec())
</code>```

I want the data from symbol_list to be dynamically added to QLabel or QLineEdit from a new line.

```<code>def connect(self):
        symbol_list = ["BTCUSDT", "DOGEUSDT"]

        ws_linear = usdt_perpetual.WebSocket(
            test=False,
            ping_interval=3000,
            ping_timeout=2000,
            domain="bybit"
            )

        ws_linear.kline_stream(
            callback=self.handleMessage,
            symbol=symbol_list,
            interval="1"
            )
</code>```

I tried through cycles, but no matter how hard I tried, it turns out:

enter image description here

I expect the output to be like this:
I expect

Body:
I can't find a way for handleMessage() to display list objects from a new line with adding them to QLabel or QLineEdit.

This is my first topic here, I immediately apologize if I framed it wrong

from PyQt6 import QtCore, QtGui, QtWidgets

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1500,200)
        MainWindow.setStyleSheet("background-color: #282828")

        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)

        self.search = QtWidgets.QLineEdit(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(32)
        self.search.setFont(font)
        self.search.setToolTipDuration(-3)
        self.search.setStyleSheet("background-color: #161a1e; color: white; border: 3px solid #161a1e")
        self.search.setObjectName("search")
        self.gridLayout.addWidget(self.search, 0, 0, 1, 4)

        self.pushButton = QtWidgets.QPushButton(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(32)
        self.pushButton.setFont(font)
        self.pushButton.setStyleSheet("background-color: #161a1e; color: white;")
        self.pushButton.setObjectName("pushButton")
        self.gridLayout.addWidget(self.pushButton, 0, 4, 1, 1)

        self.line_1 = QtWidgets.QFrame(self.centralwidget)
        self.line_1.setStyleSheet("")
        self.line_1.setObjectName("line_1")
        self.line_1.setFrameShape(QtWidgets.QFrame.Shape.HLine)
        self.line_1.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
        self.gridLayout.addWidget(self.line_1, 1, 0, 1, 5)

        self.marketLabel_1 = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.marketLabel_1.setFont(font)
        self.marketLabel_1.setStyleSheet("color: white")
        self.marketLabel_1.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.marketLabel_1.setFixedHeight(40)
        self.marketLabel_1.setObjectName("marketLabel_1")
        self.gridLayout.addWidget(self.marketLabel_1, 2, 0, 1, 1)

        self.marketLabel_2 = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.marketLabel_2.setFont(font)
        self.marketLabel_2.setStyleSheet("color: white")
        self.marketLabel_2.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.marketLabel_2.setFixedHeight(40)
        self.marketLabel_2.setObjectName("marketLabel_2")
        self.gridLayout.addWidget(self.marketLabel_2, 2, 1, 1, 1)

        self.marketLabel_3 = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.marketLabel_3.setFont(font)
        self.marketLabel_3.setStyleSheet("color: white")
        self.marketLabel_3.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)

        self.marketLabel_3.setFixedHeight(40)
        self.marketLabel_3.setObjectName("marketLabel_3")
        self.gridLayout.addWidget(self.marketLabel_3, 2, 2, 1, 1)

        self.marketLabel_4 = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.marketLabel_4.setFont(font)
        self.marketLabel_4.setStyleSheet("color: white")
        self.marketLabel_4.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.marketLabel_4.setFixedHeight(40)
        self.marketLabel_4.setObjectName("marketLabel_4")
        self.gridLayout.addWidget(self.marketLabel_4, 2, 3, 1, 1)

        self.line_2 = QtWidgets.QFrame(self.centralwidget)
        self.line_2.setStyleSheet("")
        self.line_2.setObjectName("line_2")
        self.line_2.setFrameShape(QtWidgets.QFrame.Shape.HLine)
        self.line_2.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
        self.gridLayout.addWidget(self.line_2, 3, 0, 1, 5)

        self.tradingPairs = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(26)
        self.tradingPairs.setFont(font)
        self.tradingPairs.setStyleSheet("color: white;")
        self.tradingPairs.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.tradingPairs.setFixedHeight(40)
        self.tradingPairs.setObjectName("tradingPairs")
        self.gridLayout.addWidget(self.tradingPairs, 4, 0, 1, 1)

        self.lastTradedPrice = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(26)
        self.lastTradedPrice.setFont(font)
        self.lastTradedPrice.setStyleSheet("color: white;")
        self.lastTradedPrice.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.lastTradedPrice.setObjectName("lastTradedPrice")
        self.gridLayout.addWidget(self.lastTradedPrice, 4, 1, 1, 1)

        self.percentageChange = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(26)
        self.percentageChange.setFont(font)
        self.percentageChange.setStyleSheet("color: white;")
        self.percentageChange.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.percentageChange.setObjectName("percentageChange")
        self.gridLayout.addWidget(self.percentageChange, 4, 2, 1, 1)

        self.turnover = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(26)
        self.turnover.setFont(font)
        self.turnover.setStyleSheet("color: white;")
        self.turnover.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.turnover.setObjectName("turnover")
        self.gridLayout.addWidget(self.turnover, 4, 3, 1, 1)

        self.line_3 = QtWidgets.QFrame(self.centralwidget)
        self.line_3.setStyleSheet("")
        self.line_3.setObjectName("line_3")
        self.line_3.setFrameShape(QtWidgets.QFrame.Shape.HLine)
        self.line_3.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
        self.gridLayout.addWidget(self.line_3, 1000, 0, 1, 4)

        self.notificationsLabel = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.notificationsLabel.setFont(font)
        self.notificationsLabel.setToolTipDuration(-3)
        self.notificationsLabel.setStyleSheet("color: white")
        self.notificationsLabel.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.notificationsLabel.setObjectName("notificationsLabel")
        self.gridLayout.addWidget(self.notificationsLabel, 1001, 0, 1, 5)

        self.line_4 = QtWidgets.QFrame(self.centralwidget)
        self.line_4.setStyleSheet("")
        self.line_4.setObjectName("line_5")
        self.line_4.setFrameShape(QtWidgets.QFrame.Shape.HLine)
        self.line_4.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
        self.gridLayout.addWidget(self.line_4, 1002, 0, 1,5)

        self.notificationsLabel_1 = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.notificationsLabel_1.setFont(font)
        self.notificationsLabel_1.setToolTipDuration(-3)
        self.notificationsLabel_1.setStyleSheet("color: white")
        self.notificationsLabel_1.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.notificationsLabel_1.setObjectName("notificationsLabel")
        self.gridLayout.addWidget(self.notificationsLabel_1, 1002, 0, 1, 1)

        self.notificationsLabel_2 = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.notificationsLabel_2.setFont(font)
        self.notificationsLabel_2.setToolTipDuration(-3)
        self.notificationsLabel_2.setStyleSheet("color: white")
        self.notificationsLabel_2.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.notificationsLabel_2.setObjectName("notificationsLabel")
        self.gridLayout.addWidget(self.notificationsLabel_2, 1002, 1, 1, 1)

        self.notificationsLabel_3 = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.notificationsLabel_3.setFont(font)
        self.notificationsLabel_3.setToolTipDuration(-3)
        self.notificationsLabel_3.setStyleSheet("color: white")
        self.notificationsLabel_3.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.notificationsLabel_3.setObjectName("notificationsLabel")
        self.gridLayout.addWidget(self.notificationsLabel_3, 1002, 2, 1, 1)

        self.notificationsLabel_4 = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(24)
        self.notificationsLabel_4.setFont(font)
        self.notificationsLabel_4.setToolTipDuration(-3)
        self.notificationsLabel_4.setStyleSheet("color: white")
        self.notificationsLabel_4.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.notificationsLabel_4.setObjectName("notificationsLabel")
        self.gridLayout.addWidget(self.notificationsLabel_4, 1002, 3, 1, 1)

        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.pushButton.setText(_translate("MainWindow", "найти"))
        self.marketLabel_1.setText(_translate("MainWindow", "Торговая пара"))
        self.marketLabel_2.setText(_translate("MainWindow", "Цена"))
        self.marketLabel_3.setText(_translate("MainWindow", "Изменения, %"))
        self.marketLabel_4.setText(_translate("MainWindow", "Объемы"))
        self.notificationsLabel.setText(_translate("MainWindow", "Уведомления"))
        self.notificationsLabel_1.setText(_translate("MainWindow", "Торговая пара"))
        self.notificationsLabel_2.setText(_translate("MainWindow", "Цена"))
        self.notificationsLabel_3.setText(_translate("MainWindow", "Изменения, %"))
        self.notificationsLabel_4.setText(_translate("MainWindow", "Дата и время"))

if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    MainWindow = QtWidgets.QMainWindow()
    ui = Ui_MainWindow()
    ui.setupUi(MainWindow)
    MainWindow.show()
    sys.exit(app.exec())

import sys
import time
from datetime import datetime

from plyer import notification
from pybit import usdt_perpetual
from PyQt6 import QtCore, QtGui, QtWidgets

from programWindow import Ui_MainWindow

class HandleMessage(QtWidgets.QMainWindow):
    def __init__(self, *args, **kwds):
        super(HandleMessage, self).__init__()
        self.programWindow = Ui_MainWindow()
        self.programWindow.setupUi(self)
        self.display()
        self.connect()
        self.addNewLine()

    def display(self):
        self.programWindow.search.setPlaceholderText('Пример: btc, eth, doge')
        self.programWindow.pushButton.clicked.connect(self.addNewLine)

    def connect(self):
        symbol_list = ["BTCUSDT", "DOGEUSDT"]

        ws_linear = usdt_perpetual.WebSocket(
            test=False,
            ping_interval=3000,
            ping_timeout=2000,
            domain="bybit"
            )

        ws_linear.kline_stream(
            callback=self.handleMessage,
            symbol=symbol_list,
            interval="1"
            )

    def handleMessage(self, message):
        data = message['data'][0]
        open = data["open"]
        symbol = message["topic"][9:]
        close = data['close']
        turnover = '{0:,}'.format(int(float(data['turnover']))).replace(',', '.')
        priceChange = round((close/open-1)*100, 2)

        self.programWindow.lastTradedPrice.setText(str(close))
        self.programWindow.tradingPairs.setText(symbol)
        self.programWindow.percentageChange.setText(str(priceChange))
        self.programWindow.turnover.setText(str(turnover))

        if close > open:
            self.programWindow.lastTradedPrice.setStyleSheet("color: yellow;\nborder: 0")
            self.programWindow.percentageChange.setStyleSheet("color: yellow;\nborder: 0")
        elif close < open:
            self.programWindow.lastTradedPrice.setStyleSheet("color: red;\nborder: 0")
            self.programWindow.percentageChange.setStyleSheet("color: red;\nborder: 0")
        else:
            self.programWindow.lastTradedPrice.setStyleSheet("color: white;\nborder: 0")
            self.programWindow.percentageChange.setStyleSheet("color: white;\nborder: 0")

    def addNewLine(self):

        self.tradingPairs = QtWidgets.QLineEdit(self.programWindow.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(26)
        self.tradingPairs.setFont(font)
        self.tradingPairs.setStyleSheet("color: white;")
        self.tradingPairs.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.tradingPairs.setFixedHeight(40)
        self.tradingPairs.setObjectName("tradingPairs")

        self.lastTradedPrice = QtWidgets.QLineEdit(self.programWindow.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(26)
        self.lastTradedPrice.setFont(font)
        self.lastTradedPrice.setStyleSheet("color: white;")
        self.lastTradedPrice.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.lastTradedPrice.setObjectName("lastTradedPrice")

        self.percentageChange = QtWidgets.QLineEdit(self.programWindow.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(26)
        self.percentageChange.setFont(font)
        self.percentageChange.setStyleSheet("color: white;")
        self.percentageChange.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.percentageChange.setObjectName("percentageChange")

        self.turnover = QtWidgets.QLineEdit(self.programWindow.centralwidget)
        font = QtGui.QFont()
        font.setFamily("Times New Roman")
        font.setPointSize(26)
        self.turnover.setFont(font)
        self.turnover.setStyleSheet("color: white;")
        self.turnover.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
        self.turnover.setObjectName("turnover")

        row = self.programWindow.gridLayout.count()-12

        self.programWindow.gridLayout.addWidget(self.tradingPairs, row, 0, 1, 1)
        self.programWindow.gridLayout.addWidget(self.lastTradedPrice, row, 1, 1, 1)
        self.programWindow.gridLayout.addWidget(self.percentageChange, row, 2, 1, 1)
        self.programWindow.gridLayout.addWidget(self.turnover, row, 3, 1, 1)

app = QtWidgets.QApplication([])
application = HandleMessage()
application.show()
sys.exit(app.exec())

I want the data from symbol_list to be dynamically added to QLabel or QLineEdit from a new line.

def connect(self):
        symbol_list = ["BTCUSDT", "DOGEUSDT"]

        ws_linear = usdt_perpetual.WebSocket(
            test=False,
            ping_interval=3000,
            ping_timeout=2000,
            domain="bybit"
            )

        ws_linear.kline_stream(
            callback=self.handleMessage,
            symbol=symbol_list,
            interval="1"
            )

I tried through cycles, but no matter how hard I tried, it turns out:

enter image description here

I expect the output to be like this:
I expect


来源: stackexchange

问:
How can I prompt mobile keyboard to appear on click event for word guess game?
On desktop, it always just takes keyboard input for obvious reasons, but on mobile, I can't get the keyboard to pop up in order to type at all on the click event.

Currently this is what I have:

```<code>function startGame() {
    isWin = false;
    timerCount = 10;
    startButton.disabled = true;
    renderBlanks();
    startTimer();
    startButton.addEventListener("click", prompt())
}
</code>```

I just want it to pop up when the player presses the start button. But it's just pulling up an input window. Help :(

ContentLicense: CC BY-SA 4.0

Body:
On desktop, it always just takes keyboard input for obvious reasons, but on mobile, I can't get the keyboard to pop up in order to type at all on the click event.

Currently this is what I have:

function startGame() {
    isWin = false;
    timerCount = 10;
    startButton.disabled = true;
    renderBlanks();
    startTimer();
    startButton.addEventListener("click", prompt())
}

I just want it to pop up when the player presses the start button. But it's just pulling up an input window. Help :(


问:
Unzipping tar.gz in Google Colab
I was working in Google Colab and I wanted to unzip
detection checkpoints for tensorflow 2.x

```<code>ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8.tar.gz
</code>```

Here is the code:

```<code>!tar -xzvf ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8.tar.gz
</code>```

And after runing I got these errors:

```<code>/content/gdrive/My Drive/customTF2/data
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-35-5f662a73b4f6> in <module>
      4
      5 # !wget http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8.tar.gz
----> 6 get_ipython().system('tar -xzvf ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8.tar.gz')

4 frames
/usr/lib/python3.8/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)
   1702                     if errno_num != 0:
   1703                         err_msg = os.strerror(errno_num)
-> 1704                     raise child_exception_type(errno_num, err_msg, err_filename)
   1705                 raise child_exception_type(err_msg)
   1706

FileNotFoundError: [Errno 2] No such file or directory: '/bin/bash'
</code>```

What can I do??

I tried anything but nothing helped.

Title: Unzipping tar.gz in Google Colab

Body:
I was working in Google Colab and I wanted to unzip
detection checkpoints for tensorflow 2.x

ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8.tar.gz

Here is the code:

!tar -xzvf ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8.tar.gz

And after runing I got these errors:

/content/gdrive/My Drive/customTF2/data
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-35-5f662a73b4f6> in <module>
      4
      5 # !wget http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8.tar.gz
----> 6 get_ipython().system('tar -xzvf ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8.tar.gz')

4 frames
/usr/lib/python3.8/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)
   1702                     if errno_num != 0:
   1703                         err_msg = os.strerror(errno_num)
-> 1704                     raise child_exception_type(errno_num, err_msg, err_filename)
   1705                 raise child_exception_type(err_msg)
   1706

FileNotFoundError: [Errno 2] No such file or directory: '/bin/bash'

What can I do??

I tried anything but nothing helped.


问:
How Do I Close A Hamburger Menu When Clicking On The Forward Or Back Arrow On A Browser?
Below is the code I've got set up for my responsive menu. On the hamburger menu, I have some Javascript set so that the menu will close after clicking on one of the links inside of it.

Javascript:

```<code>var elements = document.getElementsByTagName('li');
var closeHamp = function() {
 document.getElementsByClassName('cp_menuicon')[0].click();
    };

　for (var i = 0; i < elements.length; i++) {
　　elements[i].addEventListener('click', closeHamp, false);
    }
</code>```

What I'd like to do is also have the hamburger menu close when navigating between pages using the forward or backward arrow on a web browser. I've played around with a few bits of Javascript but haven't been able to achieve the result I'm looking for. If anyone knows how I could close the hamburger menu when navigating between pages I'd appreciate you sharing your knowledge with me. Thank you.

Menu:

```<code><div class="cp_cont">
<input id="cp_toggle03" type="checkbox">
<div class="cp_mobilebar">
<label for="cp_toggle03" class="cp_menuicon">
<span></span>
</label>
</div>
<label id="h-menu_black" class="cp_toggle03" for="cp_menuicon"></label>
<div id="body" class="noscroll"></div>

<header class="cp_offcm03">

<nav>
<ul style="text-align: center; margin-left: 210px; overflow: hidden;">

<li style="border-bottom: 1px solid lightgray;"><a href="#">Home</a></li>
<li style="border-bottom: 1px solid lightgray;"><a href="#">Blog</a></li>
<li style="border-bottom: 1px solid lightgray;"><a href="#">About This Website</a></li>
<li style="border-bottom: 1px solid lightgray;"><a href="#">Bibliography</a></li>
</code>```

CSS:

```<code>.body {background-color: white;
       font-family: sans-serif;
        }

.searchbar {float: right;
        }

.image {text-align: center;
        }

.setsumei {margin-left: 20px;
            margin-right: 20px;
        }

.footer {width: 100%;
         height: 40px;
         text-align: center;
         border-top: 1px solid black;
         position: absolute;
         bottom: 0;
         padding: 10px;
        }

.page-wrap {min-height: 100%;
            margin-bottom: -40px;
        }

.page-wrap:after {content: "";
                  display: block;
        }

.site-footer,
.page-wrap:after {height: 20px;
        }

.site-footer {text-align: center;
              border-top: 1px solid black;
              padding: 10px;
        }

*,
*:before,
*:after {padding-left: 0;
         margin: 0;
         box-sizing: border-box;
        }

ol,
ul {list-style: none;
        }

a {text-decoration: none;
   color: black;
        }

.cp_cont {height: auto;
        }

/* menu */
.cp_offcm03 {position: relative;
             z-index: 5000;
             top: 0;
             left: 0;
             right: 0;
             bottom: 0;
             overflow: auto;
             width: 100%;
             height: auto;
             padding-top: 0;
             -webkit-transition: transform 0.3s ease-in;
             transition: transform 0.3s ease-in;
             text-align: center;
             color: black;
             background-color: white;
        }

.cp_offcm03 nav,
.cp_offcm03 ul {height: 100%;
        }

.cp_offcm03 li {display: inline-block;
                margin-right: -6px;
        }

.cp_offcm03 a {display: block;
               padding: 15px 45px;
               margin-bottom: -5px;
              -webkit-transition: background-color .3s ease-in;
              transition: background-color .3s ease-in;
        }

.cp_offcm03 a:hover {background-color: lightgray;
        }

/* menu toggle */
#cp_toggle03 {display: none;
        }

#cp_toggle03:checked~.cp_offcm03 {-webkit-transform: translateX(0);
                                  transform: translateX(0);
        }

#cp_toggle03:checked~.cp_container {-webkit-transform: translateX(0);
                                    transform: translateX(0);
        }

.cp_mobilebar {display: none;

        }

/* content */
.cp_container {position: relative;
               top: 0;
               padding: 35px auto;
               -webkit-transition: transform .3s ease-in;
               transition: transform .3s ease-in;
        }

.cp_content {margin: 0 auto;
             padding: 20px;
             height: 65vh;
             text-align: center;

        }

@media (max-width: 1130px)and (min-width: 280px) {

/* menu */
.cp_offcm03 {position: fixed;
             left: -250px;
             overflow-y: hidden;
             width: 250px;
             height: 100%;
             padding-top: 40px;
             color: black;
             background-color: white;
             z-index: 1000;
            }

.cp_offcm03 nav {background: white;
                 border-right: 0.5px solid lightgray;
                 margin-left: -210px;
            }

.cp_offcm03 li {display: block;
                margin-right: 0;
            }

.cp_offcm03 a {padding: 20px;

            }

/* menu toggle */
.cp_mobilebar {display: block;
               z-index: 2000;
               position: relative;
               top: 0;
               left: 0;
               padding: 0 25px;
               width: 100%;
               height: 40px;
               background-color: white;
               border-bottom: .05px solid lightgray;
               }

.cp_menuicon {display: block;
              position: relative;
              width: 25px;
              height: 100%;
              cursor: pointer;
              -webkit-transition: transform .3s ease-in;
              transition: transform .3s ease-in;
            }

.cp_menuicon>span {display: block;
                   position: absolute;
                   top: 55%;
                   margin-top: -0.3em;
                   width: 100%;
                   height: 0.2em;
                   border-radius: 1px;
                   background-color: black;
                   -webkit-transition: transform .3s ease;
                   transition: transform .3s ease;
            }

.cp_menuicon>span:before,
.cp_menuicon>span:after {content: "";
                         position: absolute;
                         width: 100%;
                         height: 100%;
                         border-radius: 1px;
                         background-color: black;
                         -webkit-transition: transform .3s ease-in;
                         transition: transform .3s ease-in;
            }

.cp_menuicon>span:before {-webkit-transform: translateY(-0.6em);
                          transform: translateY(-0.6em);
            }

.cp_menuicon>span:after {-webkit-transform: translateY(0.6em);
                         transform: translateY(0.6em);
            }

#cp_toggle03:checked+.cp_mobilebar .cp_menuicon {-webkit-transform: rotate(45deg);
                                                 transform: rotate(45deg);
            }

#cp_toggle03:checked+.cp_mobilebar span:before,
#cp_toggle03:checked+.cp_mobilebar span:after {-webkit-transform: rotate(90deg);
                                               transform: rotate(90deg);
            }

#cp_toggle03:checked~.cp_offcm03 {-webkit-transform: translateX(100%);
                                  transform: translateX(100%);
            }

#cp_toggle03:checked~.cp_container {-webkit-transform: translateX(250px);
                                    transform: translateX(250px);
            }

input:checked~#h-menu_black {display: block;
                             opacity: .6;
            }

#h-menu_black {display: none;
               position: fixed;
               z-index: 999;
               top: 0;
               left: 0;
               width: 100%;
               height: 100%;
               background: black;
               opacity: 0;
               transition: .7s ease-in-out;
            }

/* content */
.cp_container {top: 60px;
               height: 92vh;
               text-align: center;
            }

.noscroll {overflow: hidden;
           position: fixed;
            }
        }
</code>```

Body:
Below is the code I've got set up for my responsive menu. On the hamburger menu, I have some Javascript set so that the menu will close after clicking on one of the links inside of it.

Javascript:

var elements = document.getElementsByTagName('li');
var closeHamp = function() {
 document.getElementsByClassName('cp_menuicon')[0].click();
    };

　for (var i = 0; i < elements.length; i++) {
　　elements[i].addEventListener('click', closeHamp, false);
    }

What I'd like to do is also have the hamburger menu close when navigating between pages using the forward or backward arrow on a web browser. I've played around with a few bits of Javascript but haven't been able to achieve the result I'm looking for. If anyone knows how I could close the hamburger menu when navigating between pages I'd appreciate you sharing your knowledge with me. Thank you.

Menu:

<input id="cp_toggle03" type="checkbox">

Home

Blog

About This Website

Bibliography

CSS:

.body {background-color: white;
       font-family: sans-serif;
        }

.searchbar {float: right;
        }

.image {text-align: center;
        }

.setsumei {margin-left: 20px;
            margin-right: 20px;
        }

.footer {width: 100%;
         height: 40px;
         text-align: center;
         border-top: 1px solid black;
         position: absolute;
         bottom: 0;
         padding: 10px;
        }

.page-wrap {min-height: 100%;
            margin-bottom: -40px;
        }

.page-wrap:after {content: "";
                  display: block;
        }

.site-footer,
.page-wrap:after {height: 20px;
        }

.site-footer {text-align: center;
              border-top: 1px solid black;
              padding: 10px;
        }

*,
*:before,
*:after {padding-left: 0;
         margin: 0;
         box-sizing: border-box;
        }

ol,
ul {list-style: none;
        }

a {text-decoration: none;
   color: black;
        }

.cp_cont {height: auto;
        }

/* menu */
.cp_offcm03 {position: relative;
             z-index: 5000;
             top: 0;
             left: 0;
             right: 0;
             bottom: 0;
             overflow: auto;
             width: 100%;
             height: auto;
             padding-top: 0;
             -webkit-transition: transform 0.3s ease-in;
             transition: transform 0.3s ease-in;
             text-align: center;
             color: black;
             background-color: white;
        }

.cp_offcm03 nav,
.cp_offcm03 ul {height: 100%;
        }

.cp_offcm03 li {display: inline-block;
                margin-right: -6px;
        }

.cp_offcm03 a {display: block;
               padding: 15px 45px;
               margin-bottom: -5px;
              -webkit-transition: background-color .3s ease-in;
              transition: background-color .3s ease-in;
        }

.cp_offcm03 a:hover {background-color: lightgray;
        }

/* menu toggle */
#cp_toggle03 {display: none;
        }

#cp_toggle03:checked~.cp_offcm03 {-webkit-transform: translateX(0);
                                  transform: translateX(0);
        }

#cp_toggle03:checked~.cp_container {-webkit-transform: translateX(0);
                                    transform: translateX(0);
        }

.cp_mobilebar {display: none;

        }

/* content */
.cp_container {position: relative;
               top: 0;
               padding: 35px auto;
               -webkit-transition: transform .3s ease-in;
               transition: transform .3s ease-in;
        }

.cp_content {margin: 0 auto;
             padding: 20px;
             height: 65vh;
             text-align: center;

        }

@media (max-width: 1130px)and (min-width: 280px) {

/* menu */
.cp_offcm03 {position: fixed;
             left: -250px;
             overflow-y: hidden;
             width: 250px;
             height: 100%;
             padding-top: 40px;
             color: black;
             background-color: white;
             z-index: 1000;
            }

.cp_offcm03 nav {background: white;
                 border-right: 0.5px solid lightgray;
                 margin-left: -210px;
            }

.cp_offcm03 li {display: block;
                margin-right: 0;
            }

.cp_offcm03 a {padding: 20px;

            }

/* menu toggle */
.cp_mobilebar {display: block;
               z-index: 2000;
               position: relative;
               top: 0;
               left: 0;
               padding: 0 25px;
               width: 100%;
               height: 40px;
               background-color: white;
               border-bottom: .05px solid lightgray;
               }

.cp_menuicon {display: block;
              position: relative;
              width: 25px;
              height: 100%;
              cursor: pointer;
              -webkit-transition: transform .3s ease-in;
              transition: transform .3s ease-in;
            }

.cp_menuicon>span {display: block;
                   position: absolute;
                   top: 55%;
                   margin-top: -0.3em;
                   width: 100%;
                   height: 0.2em;
                   border-radius: 1px;
                   background-color: black;
                   -webkit-transition: transform .3s ease;
                   transition: transform .3s ease;
            }

.cp_menuicon>span:before,
.cp_menuicon>span:after {content: "";
                         position: absolute;
                         width: 100%;
                         height: 100%;
                         border-radius: 1px;
                         background-color: black;
                         -webkit-transition: transform .3s ease-in;
                         transition: transform .3s ease-in;
            }

.cp_menuicon>span:before {-webkit-transform: translateY(-0.6em);
                          transform: translateY(-0.6em);
            }

.cp_menuicon>span:after {-webkit-transform: translateY(0.6em);
                         transform: translateY(0.6em);
            }

#cp_toggle03:checked+.cp_mobilebar .cp_menuicon {-webkit-transform: rotate(45deg);
                                                 transform: rotate(45deg);
            }

#cp_toggle03:checked+.cp_mobilebar span:before,
#cp_toggle03:checked+.cp_mobilebar span:after {-webkit-transform: rotate(90deg);
                                               transform: rotate(90deg);
            }

#cp_toggle03:checked~.cp_offcm03 {-webkit-transform: translateX(100%);
                                  transform: translateX(100%);
            }

#cp_toggle03:checked~.cp_container {-webkit-transform: translateX(250px);
                                    transform: translateX(250px);
            }

input:checked~#h-menu_black {display: block;
                             opacity: .6;
            }

#h-menu_black {display: none;
               position: fixed;
               z-index: 999;
               top: 0;
               left: 0;
               width: 100%;
               height: 100%;
               background: black;
               opacity: 0;
               transition: .7s ease-in-out;
            }

/* content */
.cp_container {top: 60px;
               height: 92vh;
               text-align: center;
            }

.noscroll {overflow: hidden;
           position: fixed;
            }
        }


问:
What's the easiest way of sending an email with attached file from GCS using Apache Airflow?
I was hoping to find GCStoEmailOperator but that doesn't seem to exist. What's the best way of sending a file from a GCS bucket to a specified email?</p>


问:
Auto indenting in jupyter notebook
When I go in next line (outside block of code) my indentation is automatically set (I accidentally turned on that option) few spaces to the middle. How can I delete that automatically set indentation? I want to start from the left side, from beginning, not few spaces away.

I tried shortcuts for indenting but that doesn't change my default auto indent in the next line

Title: Auto indenting in jupyter notebook


问:
setInterval method is interrupted in mobile PWA
I am building a pomodoro app with React and PWA feature.

I have been created a hook that helps with the countdown

useCountdown.js

```<code>import { useEffect, useState } from "react";

export function useCountdown(initialCount) {
  if (typeof initialCount !== "number") {
    return console.error("You must set an initial number in seconds");
  }

  const [intervalId, setIntervalId] = useState(null);
  const [count, setCount] = useState(initialCount);
  const [isCountdownFinished, setIsCountdownFinished] = useState(false);

  // handling functions

  useEffect(() => {
    if (count === 0) {
      setIsCountdownFinished(true);
    } else {
      setIsCountdownFinished(false);
    }
  }, [count]);

  const countdown = () => {
    // Stop countdown when reaches 0
    setCount((last) => {
      if (last <= 0) {
        clearInterval(intervalId);

        return last;
      } else return last - 1;
    });
  };

  const startCountDown = () => {
    intervalId || setIntervalId(setInterval(countdown, 1000));
  };

  const stopCountdown = () => {
    clearInterval(intervalId);
    setIntervalId(null);
  };

  const resetCountdown = () => {
    stopCountdown();
    setCount(initialCount);
  };

  const SECS_PER_MINUTE = 60;

  return [
    {
      minutes: Math.floor(count / SECS_PER_MINUTE),
      seconds: count % SECS_PER_MINUTE,
      count,
    },
    setCount,
    startCountDown,
    stopCountdown,
    resetCountdown,
    isCountdownFinished,
  ];
}
</code>```

The PWA in desktop works fine, but the problem comes when I install the app in mobile, the countdown seems to stop, I notice that It is because the browser set the app in background.

This is the app https://pomo-san.vercel.app/

I expected that it could works fine as in desktop

How can I solve that?

Body:
I am building a pomodoro app with React and PWA feature.

I have been created a hook that helps with the countdown

useCountdown.js

import { useEffect, useState } from "react";

export function useCountdown(initialCount) {
  if (typeof initialCount !== "number") {
    return console.error("You must set an initial number in seconds");
  }

  const [intervalId, setIntervalId] = useState(null);
  const [count, setCount] = useState(initialCount);
  const [isCountdownFinished, setIsCountdownFinished] = useState(false);

  // handling functions

  useEffect(() => {
    if (count === 0) {
      setIsCountdownFinished(true);
    } else {
      setIsCountdownFinished(false);
    }
  }, [count]);

  const countdown = () => {
    // Stop countdown when reaches 0
    setCount((last) => {
      if (last <= 0) {
        clearInterval(intervalId);

        return last;
      } else return last - 1;
    });
  };

  const startCountDown = () => {
    intervalId || setIntervalId(setInterval(countdown, 1000));
  };

  const stopCountdown = () => {
    clearInterval(intervalId);
    setIntervalId(null);
  };

  const resetCountdown = () => {
    stopCountdown();
    setCount(initialCount);
  };

  const SECS_PER_MINUTE = 60;

  return [
    {
      minutes: Math.floor(count / SECS_PER_MINUTE),
      seconds: count % SECS_PER_MINUTE,
      count,
    },
    setCount,
    startCountDown,
    stopCountdown,
    resetCountdown,
    isCountdownFinished,
  ];
}

The PWA in desktop works fine, but the problem comes when I install the app in mobile, the countdown seems to stop, I notice that It is because the browser set the app in background.

This is the app https://pomo-san.vercel.app/

I expected that it could works fine as in desktop

How can I solve that?


问:
What does this reflexive typedef mean?
I was browsing the Systemd / Journald header files, and in /usr/include/systemd/sd-journal.h, I noticed this line of code:

typedef struct sd_journal sd_journal;
```

It seems that the struct sd_journal is defined as... sd_journal. What does this reflexive / recursive typedef actually mean?

Title: What does this reflexive typedef mean?

Body:
I was browsing the Systemd / Journald header files, and in /usr/include/systemd/sd-journal.h, I noticed this line of code:

typedef struct sd_journal sd_journal;

It seems that the struct sd_journal is defined as... sd_journal. What does this reflexive / recursive typedef actually mean?


问:
How to make a responsive layout that doesn't stretch to the sides?
I want to make a website where if the user zooms out the content get smaller and he sees more of the page but the width of the page doesn't get stretched out to the sides.

Here is an example of a page: https://www.valhalladc.cz/ . I would like to use flexbox to obtain these results if possible.

I tried finding some tutorials but i feel like the problem is too specific and i have no idea how to solve it.


问:
OOP: How do I decide which methods to outsource and which type to use?
What do I want to do: I want to build a WebScraper for different pages (webpageA, webpageB). I want to read the title and the teaser image. Since both pages use different tags to display the title, I have two patterns.

My goal: I want to try out the principle of inheritance on a practical example to understand it.

What have I done so far: My controller receives a request with a url. The controller checks whether the URL belongs to the page webpageA or webpageB. Now it dynamically creates an instance of the corresponding service: $service = new WebpageService[A || B]($url). Then I start the scraping with $service->startScraping().

Both services implement an interface in which I have the signatures getTitle() and getImage().

class WebpageAService implements IPageService

    private string $url;
    private array $data;

    private $keyMap = [
      'key' => 'mappendKey',
       ....
    ];

   public function __construct($url) {
     $this->url = $url;
   }

    public function startScraping() {
      $this->data = // getTheDataFromApi()
      return [
        'title' => $this->getTitle(),
        'image' => $this->getImage()
      ]
    }

    public function getTitle(): string
    {
        $key = 'title';
        if (! $this->keyExists($key)) {
            return "Please enter a $key";
        }

        return $this->getValue($key);
    }

    private function keyExists(string $key): bool
    {
        if (! isset($this->data[$this->keyMap[$key]])) {
            $this->errorLog[$key] = "Error: $key with the mapped key: $this->keyMap[$key] not found on $this->url";

            return false;
        }

        return true;
    }

    private function getValue(string $key): string
    {
        return strlen($this->data[$this->keyMap[$key]]) > 0 ?
            $this->data[$this->keyMap[$key]] : $this->message['length'];
    }
}
```

My question: Can I outsource the two private functions? So that I don't have to include them for each webpage[A || B] class? If so, would a trait make sense here? I am very grateful for your hints and comments. Thanks for your time! Max

Body:
What do I want to do: I want to build a WebScraper for different pages (webpageA, webpageB). I want to read the title and the teaser image. Since both pages use different tags to display the title, I have two patterns.

My goal: I want to try out the principle of inheritance on a practical example to understand it.

What have I done so far: My controller receives a request with a url. The controller checks whether the URL belongs to the page webpageA or webpageB. Now it dynamically creates an instance of the corresponding service: $service = new WebpageService[A || B]($url). Then I start the scraping with $service->startScraping().

Both services implement an interface in which I have the signatures getTitle() and getImage().

class WebpageAService implements IPageService

    private string $url;
    private array $data;

    private $keyMap = [
      'key' => 'mappendKey',
       ....
    ];

   public function __construct($url) {
     $this->url = $url;
   }

    public function startScraping() {
      $this->data = // getTheDataFromApi()
      return [
        'title' => $this->getTitle(),
        'image' => $this->getImage()
      ]
    }

    public function getTitle(): string
    {
        $key = 'title';
        if (! $this->keyExists($key)) {
            return "Please enter a $key";
        }

        return $this->getValue($key);
    }

    private function keyExists(string $key): bool
    {
        if (! isset($this->data[$this->keyMap[$key]])) {
            $this->errorLog[$key] = "Error: $key with the mapped key: $this->keyMap[$key] not found on $this->url";

            return false;
        }

        return true;
    }

    private function getValue(string $key): string
    {
        return strlen($this->data[$this->keyMap[$key]]) > 0 ?
            $this->data[$this->keyMap[$key]] : $this->message['length'];
    }
}

My question: Can I outsource the two private functions? So that I don't have to include them for each webpage[A || B] class? If so, would a trait make sense here? I am very grateful for your hints and comments. Thanks for your time! Max


问:
Remove margins around subplots in Plotly
I have a plot made up of 3 choropleth subplots next to each other. I set the overall height and width to my desired dimensions (800 x 400 pixels). I want each subplot to go from top to bottom, but as it stands, the subplots retain the aspect ratio of 2:1, meaning I have wide margins at top and bottom. Those I want to remove.

As a minimum example, I am attaching the data and plot code:

The toy dataset:

import geopandas as gpd
from shapely.geometry.polygon import Polygon

minidf = gpd.GeoDataFrame(dict(
    krs_code = ["08111", "08118"],
    m_rugged = [42.795776, 37.324421],
    bip = [83747, 43122],
    cm3_over_1999 = [47.454688, 47.545940],
    geometry = [Polygon(((9.0397, 48.6873),
                         (9.0397, 48.8557),
                         (9.3152, 48.8557),
                         (9.3152, 48.6873),
                         (9.0397, 48.6873))),
                Polygon(((8.8757, 48.7536),
                         (8.8757, 49.0643),
                         (9.4167, 49.0643),
                         (9.4167, 48.7536),
                         (8.8757, 48.7536)))]
)).set_index("krs_code")
```
<p>The plotting code:</p>
<pre class="lang-py prettyprint-override"><code>import json
from plotly.subplots import make_subplots
import plotly.graph_objects as go

fig = make_subplots(rows = 1, cols = 3,
                    specs = [[{"type": "choropleth"}, {"type": "choropleth"}, {"type": "choropleth"}]],
                    horizontal_spacing = 0.0025 )

fig.update_layout(height = 400, width = 800,
                  margin = dict(t=0, r=0, b=0, l=0),
                  coloraxis_showscale=False )

for i, column in enumerate(["m_rugged", "cm3_over_1999", "bip"]):
    fig.add_trace(
        go.Choropleth(
                 locations = minidf.index,
                 z = minidf[column].astype(float), # Data to be color-coded
                 geojson = json.loads(minidf[["geometry"]].to_json()),
                 showscale = False
                 ),
        col = i+1, row = 1)

fig.update_geos(fitbounds="locations", visible=True)

fig.show()
</code>```

Notice the margins at top and bottom, which retain the aspect ratio of each subplot, while they are supposed to stretch from top to bottom:

I tried several parameters within go.Choropleth() and .update_layout(), but to no avail.

Body:
I have a plot made up of 3 choropleth subplots next to each other. I set the overall height and width to my desired dimensions (800 x 400 pixels). I want each subplot to go from top to bottom, but as it stands, the subplots retain the aspect ratio of 2:1, meaning I have wide margins at top and bottom. Those I want to remove.

As a minimum example, I am attaching the data and plot code:

The toy dataset:

import geopandas as gpd
from shapely.geometry.polygon import Polygon

minidf = gpd.GeoDataFrame(dict(
    krs_code = ["08111", "08118"],
    m_rugged = [42.795776, 37.324421],
    bip = [83747, 43122],
    cm3_over_1999 = [47.454688, 47.545940],
    geometry = [Polygon(((9.0397, 48.6873),
                         (9.0397, 48.8557),
                         (9.3152, 48.8557),
                         (9.3152, 48.6873),
                         (9.0397, 48.6873))),
                Polygon(((8.8757, 48.7536),
                         (8.8757, 49.0643),
                         (9.4167, 49.0643),
                         (9.4167, 48.7536),
                         (8.8757, 48.7536)))]
)).set_index("krs_code")

The plotting code:

import json
from plotly.subplots import make_subplots
import plotly.graph_objects as go

fig = make_subplots(rows = 1, cols = 3,
                    specs = [[{"type": "choropleth"}, {"type": "choropleth"}, {"type": "choropleth"}]],
                    horizontal_spacing = 0.0025 )

fig.update_layout(height = 400, width = 800,
                  margin = dict(t=0, r=0, b=0, l=0),
                  coloraxis_showscale=False )

for i, column in enumerate(["m_rugged", "cm3_over_1999", "bip"]):
    fig.add_trace(
        go.Choropleth(
                 locations = minidf.index,
                 z = minidf[column].astype(float), # Data to be color-coded
                 geojson = json.loads(minidf[["geometry"]].to_json()),
                 showscale = False
                 ),
        col = i+1, row = 1)

fig.update_geos(fitbounds="locations", visible=True)

fig.show()

Notice the margins at top and bottom, which retain the aspect ratio of each subplot, while they are supposed to stretch from top to bottom:

I tried several parameters within go.Choropleth() and .update_layout(), but to no avail.


问:
return and sql tuple descriptions are incompatible Postgresql
I have the following error

the descriptions of return and sql tuple are incompatible, I have already checked that they have the same data type, but the error persists, I would appreciate your help.

enter image description here

I have already checked that they have the same data type, but the error persists, I would appreciate your help.


问:
Error installing older version of PostGIS
I am trying to install PostGIS in Postgres-xl. Since the newest version of Postgres-XL (9.5r1.4) is based on PostgreSQL 9.5.5, I need to use an older version of PostGIS (2.3.1) due to compatibility issues.

Before PostGIS, I have installed the libgdal-dev, proj_api (ver. 4.9.1), and json-c (version 0.9). So, I successfully executed the PostGIS configure script using

```<code>./configure --with-projdir=/usr/local/
</code>```

but when I tried to build PostGIS using

```<code>sudo make
</code>```

the script returned the following errors:

```<code>/usr/bin/ld: ../../liblwgeom/.libs/liblwgeom.so: undefined reference to `pj_get_errno_ref'
/usr/bin/ld: ../../liblwgeom/.libs/liblwgeom.so: undefined reference to `pj_strerrno'
/usr/bin/ld: ../../liblwgeom/.libs/liblwgeom.so: undefined reference to `pj_transform'
</code>```

I have tried many things, such as analysing the makefiles and manually copying files to correct the references, without success. I am running on a PC using Ubuntu 22.04, and need advice to perform this install process, or sugestions of other methods to put Postgres-XL and PostGIS together.

Body:
I am trying to install PostGIS in Postgres-xl. Since the newest version of Postgres-XL (9.5r1.4) is based on PostgreSQL 9.5.5, I need to use an older version of PostGIS (2.3.1) due to compatibility issues.

Before PostGIS, I have installed the libgdal-dev, proj_api (ver. 4.9.1), and json-c (version 0.9). So, I successfully executed the PostGIS configure script using

./configure --with-projdir=/usr/local/

but when I tried to build PostGIS using

sudo make

the script returned the following errors:

/usr/bin/ld: ../../liblwgeom/.libs/liblwgeom.so: undefined reference to `pj_get_errno_ref'
/usr/bin/ld: ../../liblwgeom/.libs/liblwgeom.so: undefined reference to `pj_strerrno'
/usr/bin/ld: ../../liblwgeom/.libs/liblwgeom.so: undefined reference to `pj_transform'

I have tried many things, such as analysing the makefiles and manually copying files to correct the references, without success. I am running on a PC using Ubuntu 22.04, and need advice to perform this install process, or sugestions of other methods to put Postgres-XL and PostGIS together.


问:
How to get recent task history
I am trying to get recent history of a specific task given a task name, but I'm not sure how to do this. All the documentation I have found mention using AsyncResult and passing it an id. I want to the status/history of all the tasks that have a task name.

Also, when I look into the database all task names are null, but when checking the task name in the django python shell and celery worker logs, the task is named as expected.

Any insights or help would be appreciated.

Title: How to get recent task history


问:
Applying routine refreshes to data with ImportXML & ImportHTML AND monitoring changes
I recently scraped lists into google sheets using primarily importxml and two importhtml's. I am interested in monitoring changes made on these lists - new entries to the list and exiters. I have read so many conflicting opinions on whether

the google import functions will automatically repopulate the data in my sheets as changes occur on the websites and

the best course of action to trigger updates (coding macros I have had no luck with, doing file --> settings --> calculation --> recalculation --> on change & every hour.

I already set up up email notifications if changes are made in the sheets. I understand the websites are likely updated a monthly basis, but its been two weeks and havent gotten a notification from one of the nine links involved. My plan to assess changes being made is to analyze the version history on the doc and compare the differences. Am I missing a step in triggering auto-updates?

I'd do this in excel but I do not have a recent version where these functions are available.


问:
Comment out multiple lines in vscode with neovim and shift+v
In various Jetbrains products with a vim extension, I can use shift+v to select multiple lines, then comment or uncomment the selected lines with the Jetbrains command+/ command. With vscod(ium) + NeoVim, when I perform this same combo of shift+v, then j or k until multiple lines are selected, then command+/ , it only comments/uncomments the current line of the cursor.

What is the best way to emulate the Jetbrains behavior in vscode (or vscodium)?

I work primarily in macOS.

I am aware of using ^ to go to the beginning of the current line, then control+v combined with j/k, then shift+i, etc, but this is far more commands and harder to perform than a simple multiline select and command+/, esp. for uncommenting.


问:
Can I use bootstrap with the Mudblazor controls?
My apps all use bootstrap 5 css framework, and I'd rather not change that.  If I want to use MudBlazor can I get away from materialize and still use bootstrap?</p>


问:
HuggingFace Pipeline exceeds 512 tokens of BERT
I tested this following HuggingFace Pipeline:

https://huggingface.co/deepset/gelectra-base-germanquad

While testing it, I noticed that the pipeline has no limit for the input size.
I passed inputs with over approx. 5.400 tokens and it always gave me good results (even for answers being at the end of the input).

I tried to do it similarly (not using the pipeline but instead importing the model) by just creating several subtexts of the maximum size of 512 tokens. However, using this approach, I often get wrong results...

What approach is the HuggingFace Pipeline following here in order to be able to exceed the 512 tokens limit?

For example, lets retrieve the content of a wikipedia page, which is way over 512 tokens. Here doc is the retrieved content...

```<code>url="https://de.wikipedia.org/wiki/Gesch%C3%A4ftsbericht"
r = requests.get(url)
raw_html = r.text
doc = cleanhtml(raw_html)

question = "Wie teuer ist ein Geschäftsbericht?"
</code>```

How the Pipeline handels the prediction:

```<code>from transformers import pipeline
german_qa_model = "deepset/gelectra-base-germanquad"
qa_model = pipeline("question-answering", model=german_qa_model)
qa_model(question=question,context=doc)
>>> {'answer':'über 100.000' ,'score': 0.7242466807365417}
</code>```

Loading the model itself:

```<code>from transformers import ElectraForQuestionAnswering, Trainer
import torch

tokenizer = AutoTokenizer.from_pretrained(german_qa_model)
model = AutoModelForSequenceClassification.from_pretrained(german_qa_model)
model = Trainer(model=model)
encoding = tokenizer(question, doc, add_special_tokens=True, return_tensors="pt")
output = model(**encoding)

>>>  Error: token indices sequence length is longer than the specified maximum sequence length for this model (10402 > 512)
</code>```

Body:
I tested this following HuggingFace Pipeline:

https://huggingface.co/deepset/gelectra-base-germanquad

While testing it, I noticed that the pipeline has no limit for the input size.
I passed inputs with over approx. 5.400 tokens and it always gave me good results (even for answers being at the end of the input).

I tried to do it similarly (not using the pipeline but instead importing the model) by just creating several subtexts of the maximum size of 512 tokens. However, using this approach, I often get wrong results...

What approach is the HuggingFace Pipeline following here in order to be able to exceed the 512 tokens limit?

For example, lets retrieve the content of a wikipedia page, which is way over 512 tokens. Here doc is the retrieved content...

url="https://de.wikipedia.org/wiki/Gesch%C3%A4ftsbericht"
r = requests.get(url)
raw_html = r.text
doc = cleanhtml(raw_html)

question = "Wie teuer ist ein Geschäftsbericht?"

How the Pipeline handels the prediction:

from transformers import pipeline
german_qa_model = "deepset/gelectra-base-germanquad"
qa_model = pipeline("question-answering", model=german_qa_model)
qa_model(question=question,context=doc)
>>> {'answer':'über 100.000' ,'score': 0.7242466807365417}

Loading the model itself:

from transformers import ElectraForQuestionAnswering, Trainer
import torch

tokenizer = AutoTokenizer.from_pretrained(german_qa_model)
model = AutoModelForSequenceClassification.from_pretrained(german_qa_model)
model = Trainer(model=model)
encoding = tokenizer(question, doc, add_special_tokens=True, return_tensors="pt")
output = model(**encoding)

>>>  Error: token indices sequence length is longer than the specified maximum sequence length for this model (10402 > 512)


问:
Returning Data from 1 Field with 2 Different Types without Repeating Lines, How?
I am doing a large extract from a database for a customer and am running into an issue with one piece of their request. This is being done in MYSQL.

Currently, phone numbers are stored in a single field with a secondary field indicating what type of phone number it is (Home or Work), meaning that there may be multiple phone records for the same identity. This request is asking for all related phone numbers to be on 1 single line, so Name, Address, Home Phone, Work Phone

I'm having issues getting this data on one line, I've tried an IF statement:

```<code>SELECT Address1, Address2, City, State, Zip,
IF(a.phone_number_type_id = '1',Phone_Number, '')AS Primary_Number,
IF(a.phone_number_type_id = '3',Phone_Number,'')AS Secondary_Number
</code>```

This gave an entry for each phone number, so some had 2 lines. CASE statement attempts haven't yielded any results. My SQL is mediocre at best, so, I am looking for help here, if this is even possible. Any guidance is much appreciated.

Body:
I am doing a large extract from a database for a customer and am running into an issue with one piece of their request. This is being done in MYSQL.

Currently, phone numbers are stored in a single field with a secondary field indicating what type of phone number it is (Home or Work), meaning that there may be multiple phone records for the same identity. This request is asking for all related phone numbers to be on 1 single line, so Name, Address, Home Phone, Work Phone

I'm having issues getting this data on one line, I've tried an IF statement:

SELECT Address1, Address2, City, State, Zip,
IF(a.phone_number_type_id = '1',Phone_Number, '')AS Primary_Number,
IF(a.phone_number_type_id = '3',Phone_Number,'')AS Secondary_Number

This gave an entry for each phone number, so some had 2 lines. CASE statement attempts haven't yielded any results. My SQL is mediocre at best, so, I am looking for help here, if this is even possible. Any guidance is much appreciated.


问:
Java Jar creation - package not in src folder
Today, I updated my maven project. As a result, any of my exported jars do not work anymore because for some reason the "app" package is now exported into the root directory of my jar, instead of the src directory.

My buildpath has not changed.

As you can see, the app package is in the root directory. This folder contains all classes of the package.

But also, the app package is in the src folder. However it only contains my messages.properties file.

I export my runnable jars via Export > Export runnable jar, as I always do.

My pom.xml:

```<code><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>BMAnalyze</groupId>
<artifactId>BMAnalyze</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
    <sourceDirectory>src</sourceDirectory>
    <resources>
        <resource>
            <directory>src</directory>
            <excludes>
                <exclude>**/*.java</exclude>
            </excludes>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.10.1</version>
            <configuration>
                <release>19</release>
            </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.12.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-collections4</artifactId>
        <version>4.4</version>
    </dependency>

    <!-- JavaFx -->
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-base</artifactId>
        <version>19</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-controls</artifactId>
        <version>19</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-graphics </artifactId>
        <version>19</version>
        <classifier>win</classifier>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-fxml</artifactId>
        <version>19</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-web</artifactId>
        <version>19</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-media</artifactId>
        <version>19</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-swing</artifactId>
        <version>19</version>
    </dependency>
    <dependency>
        <groupId>org.apache.pdfbox</groupId>
        <artifactId>pdfbox</artifactId>
        <version>2.0.27</version>
    </dependency>
    <dependency>
        <groupId>com.github.dhorions</groupId>
        <artifactId>boxable</artifactId>
        <version>1.7.0</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>2.0.6</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>2.0.6</version>
    </dependency>
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>31.1-jre</version>
    </dependency>
</dependencies>
</code>```

Maybe someone can help me with this? Let me know if you need more information. Thank you

Body:
Today, I updated my maven project. As a result, any of my exported jars do not work anymore because for some reason the "app" package is now exported into the root directory of my jar, instead of the src directory.

My buildpath has not changed.

As you can see, the app package is in the root directory. This folder contains all classes of the package.

But also, the app package is in the src folder. However it only contains my messages.properties file.

I export my runnable jars via Export > Export runnable jar, as I always do.

My pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>BMAnalyze</groupId>
<artifactId>BMAnalyze</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
    <sourceDirectory>src</sourceDirectory>
    <resources>
        <resource>
            <directory>src</directory>
            <excludes>
                <exclude>**/*.java</exclude>
            </excludes>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.10.1</version>
            <configuration>
                <release>19</release>
            </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.12.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-collections4</artifactId>
        <version>4.4</version>
    </dependency>

    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-base</artifactId>
        <version>19</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-controls</artifactId>
        <version>19</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-graphics </artifactId>
        <version>19</version>
        <classifier>win</classifier>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-fxml</artifactId>
        <version>19</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-web</artifactId>
        <version>19</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-media</artifactId>
        <version>19</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-swing</artifactId>
        <version>19</version>
    </dependency>
    <dependency>
        <groupId>org.apache.pdfbox</groupId>
        <artifactId>pdfbox</artifactId>
        <version>2.0.27</version>
    </dependency>
    <dependency>
        <groupId>com.github.dhorions</groupId>
        <artifactId>boxable</artifactId>
        <version>1.7.0</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>2.0.6</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>2.0.6</version>
    </dependency>
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>31.1-jre</version>
    </dependency>
</dependencies>

Maybe someone can help me with this? Let me know if you need more information. Thank you


问:
How to handle Dot Char in Url Mapping
I have a spring boot project but, I have some links from past and users are linking url on their websites and I cannot request client to change their urls. I am trying to navigate jsp link to React app. I have just found a solution but I got stuck.

Here is the link example: abc/Dashboard.jsp#/company/88

I am handling abc/Dashbord but I cannot handle abc/Dasboard.jsp to navigate a jsp page.

There is my handling endpoint;

```<code>@Controller
@RequestMapping("")
public class DashboardController {
    @GetMapping("/Dashboard")
    public String viewBooks() {
        return "view-dashboard";
    }
}

@GetMapping("/Dashboard.jsp")
public String viewBooks2() {
    return "view-dashboard";
}
</code>```

My Jsp Page

```<code><%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
    <title>e-ŞİRKET</title>
</head>
<body>
</body>
</html>
<script>
    const url = window.location.href.split('/')

    if(url && url.length > 0) {
        const id = url[url.length -1]
        if(id) {
            window.location.replace(window.location.origin + '?page=company&company=' + id)
        }
    }

</script>
</code>```

It is working for abc/Dashboard#company/88 but;
how I can handle abc/Dashboard.jsp#/company/123. I am getting 404.

Title: How to handle Dot Char in Url Mapping

Body:
I have a spring boot project but, I have some links from past and users are linking url on their websites and I cannot request client to change their urls. I am trying to navigate jsp link to React app. I have just found a solution but I got stuck.

Here is the link example: abc/Dashboard.jsp#/company/88

I am handling abc/Dashbord but I cannot handle abc/Dasboard.jsp to navigate a jsp page.

There is my handling endpoint;

@Controller
@RequestMapping("")
public class DashboardController {
    @GetMapping("/Dashboard")
    public String viewBooks() {
        return "view-dashboard";
    }
}

@GetMapping("/Dashboard.jsp")
public String viewBooks2() {
    return "view-dashboard";
}

My Jsp Page

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

    <title>e-ŞİRKET</title>

It is working for abc/Dashboard#company/88 but;
how I can handle abc/Dashboard.jsp#/company/123. I am getting 404.


问:
Stop/Start Windows services only when state not in manual or disabled
I have an Ansible playbook to start or stop services and I needed to add a condition to pick up services that are neither in Manual nor Disabled State. Appreciate your help !!!
My code looks like this.

---
- name: windows start services
  hosts: all

  tasks:
    - name: Include primary app services
      include_vars:
        file: inventory/vars/servicestart.yml

    - name: Start task
      win_service:
        name: "{{ item }}"
        state: started
      loop: "{{ services }}"
      when: inventory_hostname in groups['primaryappservers']
```


问:
How to share template ref anywhere in the application
Hello i have a probleme for share a template ref in any component.

Stackblitz link:
https://angular-ivy-cuz2dg.stackblitz.io

Goal:
Dynamically create a list of components and be able to update this list (delete and replace components) anywhere on the application.

Currently we have:
A service that contains a reference object of all dynamic components and a table with the list of components to be created.
A parent component (app-component) that displays this list of dynamic components via a reference template (#container).

A child component (ComponentActionsComponent) that must be able to interact with the dynamic list available in the service

Issue:
The reference template (#container) is Undefined in the child component, I don’t know how to delete and replace the list of dynamic components by another.

Example:
Here is the link to an example on Stackblitz: https://stackblitz.com/edit/angular-ivy-cuz2dg?file=src/app/global.service.ts
By default, we display these 3 components dynamically:

```<code>public currentComponents = [
    'BlockAComponent',
    'BlockBComponent',
    'BlockCComponent',
  ];
</code>```

When you click on the “Switch component” button, you want to destroy the current list and create a new one, which will replace it, with these two components:
'BlockDComponent',
'BlockEComponent',

I hope someone can help me because i'm realy lost actualy

Thanks in advance

Body:
Hello i have a probleme for share a template ref in any component.

Stackblitz link:
https://angular-ivy-cuz2dg.stackblitz.io

Goal:
Dynamically create a list of components and be able to update this list (delete and replace components) anywhere on the application.

Currently we have:
A service that contains a reference object of all dynamic components and a table with the list of components to be created.
A parent component (app-component) that displays this list of dynamic components via a reference template (#container).

A child component (ComponentActionsComponent) that must be able to interact with the dynamic list available in the service

Issue:
The reference template (#container) is Undefined in the child component, I don’t know how to delete and replace the list of dynamic components by another.

Example:
Here is the link to an example on Stackblitz: https://stackblitz.com/edit/angular-ivy-cuz2dg?file=src/app/global.service.ts
By default, we display these 3 components dynamically:

public currentComponents = [
    'BlockAComponent',
    'BlockBComponent',
    'BlockCComponent',
  ];

When you click on the “Switch component” button, you want to destroy the current list and create a new one, which will replace it, with these two components:
'BlockDComponent',
'BlockEComponent',

I hope someone can help me because i'm realy lost actualy

Thanks in advance


问:
v-model not updating data from Parent to child
I Have 2 Component. 1 Is Component Form as a parent, 1 another is 3 textarea and input.
But when i submit form method post, the validation from laravel send result error, if reward_type.product, reward_type.price, reward_type[caption_note] is null.

This is my child component :

```<code><template>
    <div>
      <div>
        <label>Product Name</label>
        <textarea id="reward_type.product" name="reward_type[product]" v-model="reward_type_product" placeholder="Type product name here" required></textarea>
      </div>
      <div>
        <label>Product Value</label>
        <input type="number" id="reward_type.price" min="0" name="reward_type[price]" v-model="reward_type_price" required />
      </div>
      <div>
        <label>Product Name</label>
        <textarea id="participants-note" name="reward_type[caption_note]" v-model="reward_type_caption_note" placeholder="Type note here" :required="isEditMode"></textarea>
      </div>
    </div>
</template>

    <script>
      export default {
        name: 'reward-type',
        props: {
          type: {
            type: String,
            required: false,
            default: ''
          },
          value: {
            type: Object,
            required: true
          }
        },
        data() {
          return {
            reward_type_product: this.value.product,
            reward_type_price: this.value.price,
            reward_type_caption_note: this.value.caption_note,
          }
        },
      }
    </script>
</code>```

And this is parent form component :

```<code><template>
    <div>
      <form action="/dummy" method="post" @submit.prevent="submitCampaign">
        <overview-reward-type v-model="campaign.reward_type"></overview-reward-type>
      </form>
    </div>
</template>

    <script>
      import OverviewRewardType from '../../../../../assets/js/brand/campaign/components/OverviewRewardType.vue'

      export default {
        name: 'CampaignCreatePage',
        props: {
          type: {
            type: String,
            required: false,
            default: ''
          },
          value: {
            type: Object,
            required: true
          }
        },
        components: {
          OverviewRewardType
        },
        data() {
          return {
            campaign: this.$inertia.form({
              reward_type: {
                'type' : 'product_barter',
                'product' : '',
                'price' : '',
                'caption_note' : '',
              },
            })
          }
        },
        methods: {
          async submitCampaign() {
              console.log("On Submit Campaign")

              this.campaign.transform((data) => ({
                  ...data,
                  remember: true,
                  _token: this.$page.props.app.csrf_token

              }))
              .post(this.route('brand.campaigns.store'))

            }
          },
      }
    </script>
</code>```

This is screenshot from network when i submit form
enter image description here

And this is callback/response from validation laravel
enter image description here

I need the solution for v-model from parent to child

Body:
I Have 2 Component. 1 Is Component Form as a parent, 1 another is 3 textarea and input.
But when i submit form method post, the validation from laravel send result error, if reward_type.product, reward_type.price, reward_type[caption_note] is null.

This is my child component :

<template>

        Product Name
        <textarea id="reward_type.product" name="reward_type[product]" v-model="reward_type_product" placeholder="Type product name here" required></textarea>

        Product Value
        <input type="number" id="reward_type.price" min="0" name="reward_type[price]" v-model="reward_type_price" required />

        Product Name
        <textarea id="participants-note" name="reward_type[caption_note]" v-model="reward_type_caption_note" placeholder="Type note here" :required="isEditMode"></textarea>

</template>

And this is parent form component :

<template>

      <form action="/dummy" method="post" @submit.prevent="submitCampaign">
        <overview-reward-type v-model="campaign.reward_type"></overview-reward-type>
      </form>

</template>

This is screenshot from network when i submit form
enter image description here

And this is callback/response from validation laravel
enter image description here

I need the solution for v-model from parent to child


问:
How to connect to a MySQL db from a Chrome Extension (background.js)
I need to be able to send insert statements from background.js file in my Chrome Extension, to my MySQL db. Before this gets marked as a duplicate or I am told this is not a good idea, please note that I am the only one that will be using this extension, and it will stay in developer mode, so I do not care that my db credentials will be hardcoded. I am not looking to deploy a web-app or anything involving a server. I simply want to connect and run sql commands from my background.js file.

I have tried using the node.js packages for mysql and also tried to webpack them, which fail. Is there a package out there that still works for client side sql connections?