categories – wp_insert_category inserted category not shown in post creation

After creating a new category with following code

wp_insert_category( array(
    'taxonomy' => 'category', 
    'cat_name' => 'rolename',
    'category_nicename' => 'rolename',
) );

the category is shown correctly in admin -> posts -> categories, but while creating a new post, it’s not available on the right (categories).

SharePoint List is cutting off part of a column with text and an inserted image. How can I show all?

Very basic SP skills here!

I have a list with a column type Multiple Lines of Text. The column settings are Enhanced Rich Text.

In most rows, this column contains a few lines of text and then a .jpeg image. In the List View I created, some rows show the entire contents of this column and some rows cut the column off. When I switch to Classic Experience the entire contents show for all rows. When I switch back to the regular view I have a mix of rows with the full text and image and others that are cut off.

I have tried changing the Number of lines for editing setting from 20 to 30, to 50 and it doesn’t make any difference. Does anyone know how to solve this issue?

The users can’t switch to Classic SP as much as I prefer it.

qt – qtableview fails to display the newly inserted row

When using QtableView + QSqlTableModel combination, QtableView fails to properly display the inserted row after insertion of a new one.

The id field is hidden. The EditStrategy is OnFieldChange. There is a button to insert a new empty row at the end of the model. After the user fills in all fields and hits enter or clicks on other rows, the expected behavior is for the row to be submitted to the database and the view keeping the new row. However, the QSqlTableModel succeeds to insert the data into the database table, but the tableview’s newly inserted row becomes empty and fields uneditable.

The behavior changes to the desired one if the id field is not hidden and is explicitly provided. Yet if the id is not hidden and not populated manually, the behaviour fails again as mentioned above.

Why this happens?

Here is the minimum reproducible code. You will have to change database configuration fileds. And connect to the table with autoincrement id:

import sys

from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import QModelIndex
from PyQt5.QtSql import QSqlDatabase, QSqlTableModel
from PyQt5.QtWidgets import QPushButton


class Ui_main(object):
    def setupUi(self, main):
        main.setObjectName("main")
        main.resize(781, 652)
        main.setContextMenuPolicy(QtCore.Qt.NoContextMenu)

        self.verticalLayoutWidget = QtWidgets.QWidget(main)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 761, 631))
        self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")

        # Replace values with your database configurations
        # But the table you refer to must have autoincremented primary key
        database = QSqlDatabase.addDatabase('QPSQL')
        database.setHostName('localhost')
        database.setPort(5432)
        database.setDatabaseName('some_database')
        database.setUserName('some_user')
        database.setPassword('some_password')
        database.open()

        button_add = QPushButton("AddRow")
        button_add.clicked.connect(self.addRow)
        self.verticalLayout.addWidget(button_add)

        self.tableView = QtWidgets.QTableView(self.verticalLayoutWidget)
        self.tableView.setObjectName("tableView")
        self.tableView.verticalHeader().setVisible(False)
        self.verticalLayout.addWidget(self.tableView)

        self.table_model = QSqlTableModel(self.tableView, database)
        table_name = 'some_table'
        self.table_model.setTable(table_name)

        self.table_model.setEditStrategy(QSqlTableModel.OnFieldChange)
        self.table_model.select()

        self.tableView.setModel(self.table_model)
        self.tableView.hideColumn(0)

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

    def retranslateUi(self, main):
        _translate = QtCore.QCoreApplication.translate
        main.setWindowTitle(_translate("main", "main"))

    def addRow(self):
        count = self.table_model.rowCount(QModelIndex())
        self.table_model.insertRow(count)
        self.tableView.scrollToBottom()

if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    main_window = QtWidgets.QWidget()
    window = Ui_main()
    window.setupUi(main_window)
    main_window.show()
    sys.exit(app.exec_())

Can I use Whatsapp / take backup on phone A while having associated SIM card inserted in Phone B?

Problem Statement :
Phone A ( Nexus 6P ) cannot detect mobile network due to some issue and hence cannot receive Whatsapp verification SMS. This makes whatsapp on Phone A unusable. Phone B ( Samsung J7 Prime ) is OK in all aspects.

Proposed Idea :
Use SIM of Phone A in Phone B.
Login to whatsapp on phone A. Receive verification SMS on Phone B and access Whatsapp on Phone A using that verification SMS.
Take a whatsapp backup on Phone A and send to google drive.
Then login to whatsapp on Phone B and restore the backup on Phone B.
Finally start using Whatsapp on Phone B

Will the proposed idea work ? Will it destroy my Whatsapp shat history ?

Thanks in advance for your help !

sharepoint online – Unable to hide a column from the New form using PowerShell. Error “”The node to be inserted is from a different document context.””

i have a field of type drop-down with internal name = TicketingType, so i tried the following power shell:-

PS C:WINDOWSsystem32> Connect-PnPOnline -Url "https://0**.sharepoint.com/" -UseWebLogin
WARNING: Consider using -Interactive instead, which provides better functionality. See the documentation at
https://pnp.github.io/powershell/cmdlets/Connect-PnPOnline.html#interactive-login-for-multi-factor-authentication
PS C:WINDOWSsystem32> $ctx = Get-PnPContext
PS C:WINDOWSsystem32> $field = Get-PnPField -Identity "TicketingType"
PS C:WINDOWSsystem32> $field.SetShowInNewForm($false)
PS C:WINDOWSsystem32> $field.UpdateAndPushChanges($true)
PS C:WINDOWSsystem32> $ctx.ExecuteQuery()
Exception calling "ExecuteQuery" with "0" argument(s): "The node to be inserted is from a different document context."
At line:1 char:1
+ $ctx.ExecuteQuery()
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) (), MethodInvocationException
    + FullyQualifiedErrorId : ServerException

any advice on this please?
Thanks

audio – After using a Bluetooth speaker: Macbook headphone audiojack is inserted, but the built-in speakers keep working instead

audio – After using a Bluetooth speaker: Macbook headphone audiojack is inserted, but the built-in speakers keep working instead – Ask Different

magento2 – Magento 2.3.6 is removing Html closing tag inserted by Custom JS in Block

Something strange is happening and probably I’m missing something realy simple… but can’t understand what:

adding a custom js in a block, that add an element to the DOM. The element has several children, and I’m opening and closing tags of each children.
However, when I run the script the closing tags are gone, and all the children are embedded to each other (and I’ve checked debugging from chrome console)
I’ve tested this simple script as an example:

const parent = document.getElementById('#parent');
parent.innerHTML = "<div><div>sibling1</div><div>sibling2</div></div>";

It should render:

<div "#parent">
    <div>
        <div>sibling1</div>
        <div>sibling2</div>
    </div>
</div>

but I see all the closing tags are gone when I debug it:

parent.innerHTML = "<div><div>sibling1<div>sibling2";

which results in

<div "#parent">
    <div>
        <div>sibling1
            <div>sibling2
            </div>
        </div>
    </div>
</div>

What is happening? What is eating up my closing tags?

I’ve testes several ways to generate this innerHTML and always ends up the same.

thank you!

sql server – how to get the email address from inserted data as the recipient in sp_send_dbmail

CREATE TRIGGER TestTrigger ON dbo.table1
FOR INSERT AS

DECLARE @fname VARCHAR(255)
DECLARE @lname VARCHAR(255)
DECLARE @email VARCHAR(255)
DECLARE @body VARCHAR(255)

SELECT @fname=(fname) FROM INSERTED
SELECT @lname=(lname) FROM INSERTED
SELECT @email=(email) FROM INSERTED

SET @body = @fname + @lname + @email

EXEC msdb.dbo.sp_send_dbmail
@profile_name=’default’,
@recipients = ”,
@subject=’Test message’,
@body= @body

json – How to send data destined to be inserted into a database from a web browser application

Is there a standard way to send data entered from a user in a web form to the web application to be inserted into tables in a database.

On the server I have code which uses prepared statements to insert data into database tables. I am designing the flow of data from client to server and back again and wondered if there are standard ways to go about this?

My initial idea was, user enters data in fields and when user hits send button the data values are processed and converted into json to be sent to the server as a POST request, content-type: application/json (will use ajax). But the user could enter any old garbage and so what do I do about that? Do I base64 encode the data before converting to json?

I don’t mind the user saving garbage or odd characters in the database. I just have to be careful that I can get the data to the database without any bugs or security concerns.

Does the take data, base64 encode then convert to json idea sound good? Any alternatives?

DreamProxies - Cheapest USA Elite Private Proxies 100 Cheapest USA Private Proxies Buy 200 Cheap USA Private Proxies 400 Best Private Proxies Cheap 1000 USA Private Proxies 2000 USA Private Proxies 5000 Cheap USA Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive.com Proxies-free.com New Proxy Lists Every Day Proxies123.com Proxyti.com Buy Quality Private Proxies