Javascript – Because the error "SCRIPT1004: & # 39 ;; & # 39; is expected" generated when running the application in Internet Explorer?

The for..of is not supported by IE, I mean this:

for (let child of element.children){

The let is partially supported by IE11, set to:

for (var i = element.children.length - 1; i >= 0; i--) {
    element.removeChild(element.children(i));
}

The loop must be backward because the index is "readjusted" each time an element is removed.

Take advantage and isolate the math operation from chaining by isolating with (...)

triangle.style.left = (element.offsetWidth / 2 - triangle.offsetWidth / 2) + "px";
triangle.style.top = (element.offsetHeight / 2 - triangle.offsetHeight / 2) + "px";

It is good to be careful and isolate even when doing math operations, because then you will not be disturbed by the operators who have "priority".

Check that the MySQL server is running

How can I check the readiness of a MySQL database for which a user and password have already been set?

Without a password, the command should be:

mysqladmin ping -h localhost

In my test environment, a password for the environment variable is already set in the MySQL database MYSQL_ROOT_PASSWORD called abc123, Simply enter the password -p doesn't seem to do the trick:

mysqladmin ping -h localhost -p abc123

The MySQL database takes about 20 seconds to start on average.

Authentication – How is it that RFC7636 (PKCE) prevents malicious apps from running the same code request and that they get legitimate access to the API?

According to RFC7636, malicious apps that pretend to be legitimate apps are stopped and given access to OAuth2.0-protected APIs.

The process suggests a method with which a secret generated by the client is created at runtime level and the authentication server is informed that this is the case. In this way, the token issuer can check the secret with the authentication server and issue a correct access token.

However, let's assume that a malicious app with a correct client_id and client_secret can perform the same PKCE process and gain access to protected resources as suggested in the RFC paper.

Isn't this RFC meant to protect such attacks, or am I just missing something here?

virtualbox – How do I track a port from my PC to a Lunix VM running on the same computer?

I created a virtual machine on my PC by installing Docker Toolbox.

My Docker image seems to be running and should forward https: // localhost: 44344 to my VM, which is hosted at IP address 192.168.99.100:443, while http: // localhost: 32769 redirects to 192.168.100: 80 becomes.

However, when I try to search the page, I get Unable to connect Browser error.

How can I track the connection between my local host and my Docker computer to ensure that the connection reaches the end point? Or are there other suggestions to fix this problem so that I can view my website running on the VM using https: // localhost: 44344 or http: // localhost: 32769?

magento2 – Fights to get Magento up and running

Hello, I'm trying to get Magento to work on my laptop. The first problem I encountered was a black screen, but it could be fixed. My next problem is the infinite loading after the admin login in the backend. Enter image description here

I have already increased the memory limit in php.ini to 2048M, that was 512M. Browser caches already deleted. Currently with xampp 7.3.13 and Magento 2.3.3.

Would really appreciate it if someone can help me.

postgresql – psql database slow, shows long running active queries, statement_timeout does not work

I have a psql database that is accessed via a node.js API with a native mobile response app. It doesn't matter what the peculiarities of the code stack are, but basically there are queries in the psql database that appear as status = & # 39; active & # 39; apply to days that slow down the entire database. Use the following to check:

SELECT
  pid,
  now() - pg_stat_activity.query_start AS duration,
  query,
  state
FROM pg_stat_activity
WHERE (now() - pg_stat_activity.query_start) > interval '5 minutes';

End the active queries manually with

SELECT pg_cancel_backend(__pid__)

fixes the problem and brings the database back to normal speed. Of course, we want to make sure that this doesn't necessarily happen and that our app slows down for all users.

Another thing to mention is that I tried to time the active queries with statement_timeout, but I'm not sure I'm doing it right. Testing with …

SET statement_timeout = 1;
SELECT * from "table_name";

it does not work. That means … The above SELECT statement takes 400 milliseconds and does not end. Seems that I don't have this procedure properly. The instruction works

SET statement_timeout = 10000;
SELECT pg_sleep(15);

thereby canceling the second statement. Does this mean that statement_timeout only works with inactive processes and not with execution times?

The specifics of the query (including unusual elements, everything else is normal & # 39; where & # 39; statements)

  1. It is a select statement that joins three tables: two of them are normal, one is a zip code table with more than 40,000 rows that are indexed in the zip code column.
  2. There is a CASE statement in the SELECT part (before where), such as
(CASE
                        WHEN
                            (SELECT earth_distance(
                            ll_to_earth(z.lat, z.lng),
                            ll_to_earth((SELECT lat from zipcodes where zipcode = ''),
                                        (SELECT lng from zipcodes where zipcode = ''))) / 1609.34) <= 5
                        THEN 0
                        WHEN
                            (SELECT earth_distance(
                            ll_to_earth(z.lat, z.lng),
                            ll_to_earth((SELECT lat from zipcodes where zipcode = ''),
                                        (SELECT lng from zipcodes where zipcode = ''))) / 1609.34) <= 10
                        THEN 1
                        WHEN
                            (SELECT earth_distance(
                            ll_to_earth(z.lat, z.lng),
                            ll_to_earth((SELECT lat from zipcodes where zipcode = ''),
                                        (SELECT lng from zipcodes where zipcode = ''))) / 1609.34) <= 20
                        THEN 2
                        ELSE (SELECT earth_distance(
                            ll_to_earth(z.lat, z.lng),
                            ll_to_earth((SELECT lat from zipcodes where zipcode = ''),
                                        (SELECT lng from zipcodes where zipcode = ''))))
                    END   )
                    AS distance

Yes, this definitely seems to take some time, but not for most users. And still, why should this query be shown as "active" for days? For example, if the zip code could not be found in the zip code table, nothing is returned or an error is output.

Any help is greatly appreciated! Even if you see something wrong, you are welcome to comment on it! Forgive me simple things I missed :-)!

grub2 – aptitude is stuck in a loop after running apt autoremove

Every time I update packages, I'm stuck in this menu:

  │ A new version of /boot/grub/menu.lst is available, but the version installed currently has been locally modified.  │
                            │                                                                                                                    │
                            │ What would you like to do about menu.lst?                                                                          │
                            │                                                                                                                    │
                            │                             install the package maintainer's version                                               │
                            │                             keep the local version currently installed                                             │
                            │                             show the differences between the versions                                              │
                            │                             show a side-by-side difference between the versions                                    │
                            │                             show a 3-way difference between available versions                                     │
                            │                             do a 3-way merge between available versions (experimental)                             │
                            │                             start a new shell to examine the situation                                             │
                            │                                                                                                                    │
                            │                                                                                                                    │
                            │                                                                                                                │
                            │

I tried removing the kernel headers with apt autoremove to free up space and now all the updates hang in this loop no matter what you choose and show you this menu.

Any idea how to fix the problem?

Ubuntu 16.04.4 LTS (GNU / Linux 4.4.0-170 generic x86_64)

Is there a way to query the blockchain locally when a full node is running?

If you want to query your full node, you should use the JSON-RPC API. Note that by default you can only get blocks and transactions from your own full node wallet. If you want to be able to query transactions, you have to add txindex=1 to your configuration file. And compared to blockchain.info, you can’t query addresses.

Server – How can I end a screen session when no processes are running?

I use screen running a Minecraft server and I restart it every day. This is my start code:

screen -mdS mcserver
screen -S mcserver -p 0 -X stuff "java -Xmx4G -jar server.jar^M"

This is my stop code:

screen -S mcserver -p 0 -X stuff "stop^M"
sleep 10
screen -XS mcserver quit

Send command stop Lets the Minecraft server save the world, which can take a few seconds. Is there a way to make the program wait until java (The Minecraft server) doesn't run and then kills screen? If I kill screen before i broadcast stop For Minecraft, the world can have a few glitches. (Player items are no longer synchronized by the world blocks, people lose items and accidentally duplicate things.)