Lollipop 5.1: how can I insert a foreign key automatically when I insert data in the main table and insert data in the second table

I have two tables, the first product table makes prid integer primary key automatically increase the attribute two pro_name unique text when we insert it and insert data in the second productMultiValue table in the same activity inserted only with an external key that refers to the product.
Please help me boy

Server: Apache crashes and automatically restarts in digitalocean

I recently requested a change in my root password that was successful and I can use it in the console. However, my IP address stopped working. Both visiting my domain and SSH are responding with an exhausted connection error.

It worked fine until I changed my root password and the server rebooted.

I checked the error log using this command:

tail -50 /var/log/apache2/error.log

And this is what I got:

(Mon Jan 20 00:47:06.157921 2020) (mpm_prefork:notice) (pid 994) AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
(Mon Jan 20 00:47:06.157921 2020) (core:notice) (pid 994) AH00094: Command line: '/usr/sbin/apache2'
(Mon Jan 20 00:47:06.157921 2020) (mpm_prefork:notice) (pid 981) AH00169: caught SIGTERM, shutting down
(Mon Jan 20 00:47:06.157921 2020) (mpm_prefork:notice) (pid 970) AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
(Mon Jan 20 00:47:06.157921 2020 (core:notice) (pid 970) AH00094: Command line: '/usr/sbin/apache2'
(Mon Jan 20 00:47:06.157921 2020) (mpm_prefork:notice) (pid 903) AH00169: caught SIGTERM, shutting down
(Mon Jan 20 00:47:06.157921 2020) (mpm_prefork:notice) (pid 903) AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
(Mon Jan 20 00:47:06.157921 2020) (core:notice) (pid 994) AH00094: Command line: '/usr/sbin/apache2'
(Mon Jan 20 00:47:06.157921 2020) (mpm_prefork:notice) (pid 994) AH00169: caught SIGTERM, shutting down
(Mon Jan 20 00:47:06.157921 2020) (mpm_prefork:notice) (pid 970) AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
(Mon Jan 20 00:47:06.157921 2020) (core:notice) (pid 990) AH00094: Command line: '/usr/sbin/apache2'

Observe the SIGTERM, shutting down? I think Apache is blocking and the service restarts automatically.

At first I thought it was as a result of low memory usage, then I checked with this command free -mh

Here are the results. My ram is enough:

              total        used        free      shared  buff/cache   available
Mem:           1.9G        259M        1.4G         612K        258M        1.6G
Swap:            0B          0B          0B

The firewall is inactive, so nothing blocks port 80

sudo ufw status
Status: Inactive

I also execute this command to see what is being heard

sudo lsof -iTCP -sTCP:LISTEN -P

COMMAND    PID           USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
sshd      812           root    3u  IPv4  18468      0t0  TCP  localhost:53 (LISTEN)
sshd      812           root    4u  IPv6  18468      0t0  TCP *:22 (LISTEN)
mysqld      899           mysql    29u  IPv4  19368      0t0  TCP localhost:3306 (LISTEN)
master      1089           root    13u  IPv4  19478      0t0  TCP *:25 (LISTEN)
master      1089           root    14u  IPv6  19479      0t0  TCP *:25 (LISTEN)

Could it be my Apache configuration?
this is what is heard in me /etc/apache2/ports.conf

grep "Listen" /etc/apache2/*.conf

etc/apache2/ports.conf: Listen 0.0.0.0

etc/apache2/ports.conf: Listen 433
etc/apache2/ports.conf: Listen 433

I can't even restart Apache, it doesn't let me

service apache2 restart

Job for apache2.service failed because the control proccess exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.

When executing that command I got this:

apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset
Drop-In: /lib/systemd/system/apache2.service.d
         apache-system.conf
Active: failed (Result: exit-code) since Mon 2020-01-20 12:16:35 UTC; 4min 9s
Process: 1616 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE

This is normal? Please help

SharePoint automatically restores / removes values ​​from DropDown files when editing the item

I have a very strange problem in my SharePoint lists. I have a website with three different lists. From today I have the following problem: when I open an item to edit a value in a field, each DropDown field automatically deletes the stored value. I experience this problem for each of the three lists. I have also created a new test list and even here I experience this problem.
This behavior definitely did not exist a few days ago. Do you have any idea what is going on?

I hope someone can help. Best!

I want to automatically change the uppercase text and font size in the Google sheet script, can anyone help me?

function onEdit(e) {
  if (typeof e.value != 'object') {
    e.range.setValue(e.value.toUpperCase());
  }
}
function onEdit() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
 var sheet = ss.getActiveSheet();

  var cell = sheet.getRange('A:J');
 cell.setFontFamily('Calibri').setFontSize('12').setFontWeight('');
}

Why does Google Chrome automatically close …?

Hello friends,

Why does Google Chrome automatically close …?

Why does Google Chrome automatically close …?

Security – Is a police escort (SPU) in Somaliland automatically assigned abroad or should the foreigner request it?

I have read that a police escort from the Elite Special Police Unit (SPU) in Somaliland is required when traveling outside Hargeisa. E.g. https://www.onceinalifetimejourney.com/reviews/everything-else/safety-in-somaliland-is-somaliland-safe-to-visit/#Police_escort_in_Somaliland:

One of the most unique parts of traveling in Somaliland is the mandatory police escort that all visitors outside Hargeisa receive.

Is a police escort assigned in Somaliland automatically abroad or should the foreigner request it? If it is automatic, how does the police realize that the foreigner needs a police escort? If it is not automatic, how does the foreigner request the police escort?

magento2 – Prevents the "New order" checkboxes from being rechecked automatically

I edited the adminhtml template for these check boxes (totals.phtml) and successfully removed the "marked" attribute that causes them to be verified by default. Now, when the New Order page is first loaded for the administrator, these boxes are checked. However, as soon as I perform an action on the page (like adding a product to the order), the boxes are automatically rechecked. How can I prevent this behavior?

enter the description of the image here

machine learning: how to automatically get the longest line in the dendrogram?

Instead of manually guessing the longest vertical line, is there any way to automate it? Or to highlight it clearly in the graph?

:
I know Elbow's method but I need this information about the dendrogram.

My code

# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

# Importing the dataset
dataset = pd.read_csv('Mall_Customers.csv')
X = dataset.iloc(:, (3, 4)).values

# Using the dendrogram to find the optimal number of clusters
import scipy.cluster.hierarchy as sch
dendrogram = sch.dendrogram(sch.linkage(X, method = 'ward'))
plt.title('Dendrogram')
plt.xlabel('Customers')
plt.ylabel('Euclidean distances')
plt.show()

Dendrogram
Dendrogram