How to calculate the local maxima/minima for cubic regression functions

We have a regression with cubic explanatory variables. It looks like this:

reg y x x2 x3 Where x2 is the squared (x²) and x3 the cubic (x³) form of x. Now, is there an easy way (maybe a package) to calculate the local/global minima and maxima (or turning points), instead of having to go the way through the first derivation and the quadratic formula and the second derivation with the obtained nulls. The quadratic formula for the obtained regression coefficients would look like this:

display (-(2*_b[_x2]) +/- sqrt((2*_b[_x2])^2-4*(3*_b[_x3])*_b[_x]) / 2* (3*_b[_x3])

ubuntu 18.04 ufw how to allow local 3306 connections to mysql?

If I run this command:

mysql -u root -p -h -P 3306

with the correct password (yes, I have the correct password) it says access denied

I run the exact same thing, just disable ufw first sudo ufw disable

then the above command, and it works. But: now ufw is disabled :S

What I really want to do is connect via mysql workbench using ssh but without disabling ufw altogether, and without allowing none ssh access to my mysql installation?

Global to local principle for f.g. $\mathbb{Z}[x]$ modules

In graduate school, while I was working on the maximal subgroup growth of certain metabelian groups, I discovered and proved a lemma which gave me the impression that it was already known. Do you know of any reference for this result? Does it follow easily from a known result? Here is the result:

Let $ N$ be a finitely generated $ \mathbb{Z}[x]$ -module. Suppose (by using the fundamental theorem of f.g. modules over PIDs) we have the following isomorphism of $ \mathbb{Q}[x]$ -modules:

$ $ \mathbb{Q} \otimes_\mathbb{Z} N \cong \left( \bigoplus_{j=1}^{s_1} \mathbb{Q}[x]/(a_j) \right) \oplus \mathbb{Q}[x]^{s_2} $ $ for some $ a_j \in \mathbb{Q}[x]$ that are not units and such that $ a_1 \mid a_2 \mid \ldots \mid a_{s_1}$ .

Then for all large primes $ p$ , we have the following isomorphism of $ \mathbb{F}_p[x]$ -modules:

$ $ N/pN \cong \left( \bigoplus_{j=1}^{s_1} \mathbb{F}_p[x]/(\overline{a_j}) \right) \oplus \mathbb{F}_p[x]^{s_2}.$ $

While my proof of the above result is about three pages long, I do have a short heuristic argument:

When doing the computation required in finding the decomposition of $ \mathbb{Q} \otimes N$ into a direct sum of cyclic modules, the only thing keeping us from doing this computation to $ N$ itself (as a $ \mathbb{Z}[x]$ -module) is that we may need to divide by finitely many integers.

So if $ p$ is large enough, then in $ \mathbb{F}_p$ we can divide by all those integers (i.e. their residues mod $ p$ ). For such $ p$ , the steps of the algorithm would be the same for $ N/pN$ as for $ \mathbb{Q} \otimes N$ .

In case you are interested, this is Lemma 41 in my arXiv paper Maximal subgroup growth of some metabelian groups. I actually proved a slight generalization, concerning finitely generated $ D^{-1}\mathbb{Z}[x]$ -modules, where $ D$ is the multiplicative closure of a finite set of primes.

How to retrieve the ID of the received local notification in android studio?

I am creating an app that includes scheduled notifications that are uniquely identified by the Notification_ID. The response to each notification is different, but I don’t want to create multiple Channel_ID (same channel_ID for all notifications). When I receive a notification, how can I retrieve the Notification_ID?

Let’s say I triggered 3 notifications with different Ids: (same channel ID)

1- notificationManager.notify (“100”,; //first notification with ID 100

2- notificationManager.notify (“200”,; //second notification with ID 200

3- notificationManager.notify (“300”,; //third notification with ID 300

When I receive all 3 notifications and press on one of them, how can I retrieve the ID of that notification?

If anyone can help, it would be great. Moving messages out of IMAP accounts to local folders without keeping a copy in the Archive

I have my set up with multiple email accounts (from different providers).

For each of these accounts, I would like to make sure that when I drag an email out of the respective inbox into a custom “On my Mac” folder, that it gets deleted (or ends up in the IMAP Trash folder).
However, this only works for the iCloud account. For Gmail accounts, unfortunately, when I drag an email out of a Gmail inbox, it ends up in the IMAP All Mail folder (under “Archive”) and not in the Trash.

See the screenshot below of my setup: Dragging a message from Inbox > iCloud into On My Mac > A Local Test Folder deletes the message from iCloud (it doesn’t show up in either the Trash > iCloud or the Archive > iCloud folders

enter image description here

Dragging a message from Inbox > Account A into On My Mac > A Local Test Folder*8 moves the message into **Archive > Account A (All Mail)

I would like it to be either moved into the Trash > Account A folder (so that it eventually gets deleted from the server), or to be deleted immediately.

Here’s what I tried: In the Gmail settings (in the browser) under Forwarding and POP/IMAP > IMAP access I changed the setting for When I mark a message in IMAP as deleted: from “Auto-Expunge on” to “Auto-Expunge off” and then changed the next option to “Move the message to the Trash” or, after that didn’t work, to “Delete immediately”.
Neither setting does have any effect on the behavior in Mail. The message still appears under “Archive”.

Then, in the Preferences > Accounts > Mailbox Behaviors > for all Mailboxes (Drafts, Sent, Junk, Trash) I can choose if I want the IMAP or On My Mac version of the mailbox to be used. See the screenshot below illustrating this option for Trash.

enter image description here

However, for Archive Mailbox there is no such option. I can only choose [Gmail]/All Mail.

enter image description here

If there was a way to make it either use the Gmail Trash folder or the On My Mac Archive folder, that would already be of help.

How to install hadoop reusable on a local network?

For a multi-node image cluster on an institute, we have sevaral laptops and machines and we want to create a hadoop cluster with hbase on the top for indexing the data/images.

I have tried some VMare and docker solutions, but the most tutorials are deprecated and very complicated. The sandboxes are not recommended for a productional usage.

I have now, 3 macbook pros with 16gb ram, 2 win pcs with 8gb ram.

I want to take a macbook as a masternode and the other machines as slaves / datanodes.

What’s the best way for us to end up with a cluster where we can read and write very large image files? The cluster will set up in a local network.

Thanks in advice.

Why my API requests worked on local, but not on my server?

I’m new with Laravel, so I tried something simple :

  • create a route to api (‘myVirtualHost.test/api/v1/sources’) which return some JSON when I requested it with postman.

It worked well.

  • Now, I pushed it on my VPS and tried the same thing : 404 NOT FOUND.

What I’ve done :

I split my laravel folder into 2 folders for more security : The “public” folder’s content is in “/var/www/html/server” (not in root folder because I have some others subfolders for others project) The Laravel other’s content are in “/var/www/server”

  • My Apache2 conf (/etc/apache2/sites-available/000-default.con) is:

    ServerAdmin webmaster@localhost DocumentRoot /var/www/html

    ErrorLog $  {APACHE_LOG_DIR}/error.log CustomLog $  {APACHE_LOG_DIR}/access.log combined  <Directory "/var/www/html/myFirstProject">   AllowOverride All </Directory> <Directory "/var/www/html/mySecondProject">   AllowOverride All </Directory> <Directory /var/www/html/server>   AllowOverride All </Directory> 

  • I changed paths from index.php (/var/www/html/server/index.php)

  • Storage and Bootstrapp folders have permissions