## Confusion about P against NP

I am sure that my reasoning in the following question is extremely simple and erroneous, but I think that if anyone answers, I can better understand what the P vs. NP puzzle is. So here's my question: Why is the following not proof that NP is not equal to P?

Scenario: A computer is assigned an n-digit number that it must guess. The numbers of this number were selected at random. Since the digits are randomly selected, there is no pattern a computer could detect, and this simplifies the problem. All solutions must be tried, of which there are 9 ^ n.

Does the problem with my argument lie in the assumption that the numbers are really random? Randomness is impossible and there will always be an underlying pattern for how seemingly "random" numbers have been selected

## magento2 – shipping price and grand total excluding VAT. confusion

Our calculation for shipping, taxes and total (excluding taxes) is incorrect. We have set the shipping and handling fees to include the taxes in the settings. Shipping will still be added to the total amount (excluding taxes).

See the example below (here VAT is 24%).

``````Subtotal                €141.05
Shipping & Handling     €7.90
Grand Total (Excl.Tax)  €148.95     (141.05+7.90 = 148.95)
Total Tax               €33.85      (141.05*0.24 = 33.85)
Grand Total (Incl.Tax)  €182.80
``````

As you can see, shipping is added to the total without taxes, but the total tax is only calculated from the subtotal. We want the total (without tax) + total + shipping = total (tax included) to be clearly displayed. How should we handle this?

Magento 2.3.2

## Lexical and syntactic error confusion in C

Identify the compiler's answer to this line while creating the object module:

(A) No compilation error

(B) Only a lexical error

(C) Only syntactic errors

(D) Both lexical and syntactic errors

## Confusion about the ASP.NET core routing engine

I'm trying to give a solid example of how the ASP.NET Core routing engine works, and I was surprised by the results.

The prerequisite for this example is that a controller index page is called and then AJAX requests to load data are used.

I have created an ASP.Net Core application with MVC. Then I added the following controller:

``````namespace WebApplication2.Controllers {
using Microsoft.AspNetCore.Mvc;

public class SearchController : Controller {
public IActionResult Index() {
return View();
}

(HttpGet("{company}"))
public IActionResult Get(string company) {
return Ok(\$"company: {company}");
}

(HttpGet("{country}/{program}"))
public IActionResult Get(string country, string program) {
return Ok(\$"country: {country} program: {program}");
}
}
}
``````

I'll also create a simple view that follows the index with the words "search page" so you can see how it's called.

The problem is that the resulting routes do not make sense.

## expected results

• / Search / Index
• / Search / {Company}
• / Search / {country} / {program}

Using the example of company: "Abc", country: "Canada" and program: "Sanitary":

## Actual results

It does not work that way at all. Instead, these are the results:

Produced: "Country: Search Program: Index"

Produced: "Country: Search Program: Abc"

Obviously, the routes for index and get string company are confused, and the name of the controller is treated as a parameter.

I can get it working with the following code, but I thought the routing engine would get the same results:

``````    public class SearchController : Controller {
public IActionResult Index() {
return View();
}

(HttpGet("(controller)/{company}"))
public IActionResult Get(string company) {
return Ok(\$"company: {company}");
}

(HttpGet("(controller)/{country}/{program}"))
public IActionResult Get(string country, string program) {
return Ok(\$"country: {country} program: {program}");
}
``````

What's wrong with my understanding? It seems silly to have to state `(controller)` expressly.

## Sensor – What are the appropriate values ​​for the confusion circle for high megapixel cameras?

DOF-CoC is not about megapixels, but about the size of the sensor diagonal and the degree of expected magnification. Using a popular 35 mm film, the general estimate CoC was 0.03 mm. Because the 35mm film diagonal is 43.3mm and the standard definition display for a magnification of 8×10 inches (viewed from a distance of 10 inches) is diagonal / 1442, giving 0.03mm. This is the point size that a human eye may possibly see (to perceive an enlarged spot size at 10 inches) and DOF is calculated as CoC and magnification reach that size. The 0.03 mm is only valid for 35 mm film size (the sensor diagonal). The full-size DSLR (now also 36 x 24 mm) and the popular APS (24 x 16 mm) sensors are 0.02 mm in size and still provide a magnification of 8 x 10 inches.

In the past, there were other estimates for CoC: diagonal / 1732 at the beginning and later diagonal / 1500. However, the CoC numbers of 0.03 and 0.02 mm became popular among Japanese camera manufacturers, and this is an implicit divisor of 1442 ( is used by virtually all online DOF machines).

The smaller the sensor (which requires a larger magnification) or the larger the magnification than 8×10 inches, the better the blur can be visually perceived. Therefore, the CoC limit must be smaller (to recognize the blur in the same way). If you instead display a smaller image or have a larger sensor, the CoC value may increase.

Depth of field calculators must ask for the sensor size to calculate the usable CoC. However, the DOF standard still assumes that a size of 8 x 10 inches will be displayed at 10 inches (rarely mentioned today). I have one under https://www.scantips.com/lights/dof.html, which also queries the print size (magnification) and also provides different divider.

## General Topology – Confusion about the definition of inner points in Rudin's real analysis

So the definition of an inner point of E, if there is a neighborhood N of p, so that N is a correct subset of E in X (metric space).
(Incidentally, a neighborhood of p is a set Nr (p) consisting of all q such that d (p, q) is 0).

Suppose I choose X as {x: (1,3) union {5}}, and E is (1,3) if I choose p = 3 for r = 1, so the neighborhood of p should be within r The correct subset of E. S0 point p should be the inner point of E, but I know that this is not the case. Do I misunderstand the concept of metric space (according to the definition of the book, it is only a set whose elements are points with distance property) or has something else gone wrong? Thanks a lot!

## Proof of correctness – confusion of loop-invariant initialization

Consider the following algorithm, LastMatch, which returns the offset of the last one
Pattern P appears in text T or -1 if P does not occur in T:

``````LastMatch(T,P)
for(s = T.length - P.length downto 0)
j = 1
while(j =< P.length and P(j) == T(s + j))
j++
if(j == P.length + 1)
return s
return -1
``````

I've got an invariant loop for the while loop:

$$forall k (1 leqk

The initialization of this invariant confuses me. Before we enter the while loop, $$j = 1$$, So we ask if there is one $$1 leq k <1$$ so that $$P (k) == T (s + k)$$?

I can not find one $$k$$ what satisfies this inequality, I do not understand what that says. So why is the invariant satisfied before we enter the loop? Is it because if I can not find one? $$k$$ it implies that $$P (k)$$ and $$T (s + k)$$ are they both equal to the empty crowd?

## Consensus – confusion about certain Blockchain jargon

I'm really struggling to get a grip on a certain part of the bitcoin / blockchain terminology, and would really appreciate it if someone was able to bring a little bit of clarity. I've read a lot to find out, but the more I read, the more confusing it seems to be.

Basically it's about consensus and governance.

As far as I know, we have the following with blockchain technology:

• Miners need consensus about which "next transaction block" is added to the chain (and the longest chain becomes the valid chain in the network).
• Consensus is needed on which version of the protocol is used (disagreements lead to a hard fork).

My main question to the above: Are both called "consensus" or is there a terminology that separates the two? (When I open a new article on governance and consensus, I have to read half of it to find out what kind of "consensus" the author refers to.

So, would governance be the developers that have the authority to merge changes in the main Bitcoin codebase?

## Linux kernel vfs_write function confusion

I looked at the old Linux kernel code (3.10.1), especially the I / O path.

So when the IO enters the VFS layer, the function becomes `vfs_write()` is called.

Here I can see a call `file->f_op->write()`This is a blocking call as a man page of the system call `write()` says.

The other option in the code is when `file->f_op->write` In this case, the pointer is undefined `vfs_write()` Calls `do_sync_write()`,

`do_sync_write() goes ahead and calls`filp-> f_op-> aio_write () `, an asynchronous call, as explained in the man page of aio_write.

Now my question is, why was the function `do_sync_write()` with the name "sync", if it is clearly about calling an asynchronous io function?

I'm probably missing something, or was it a mistake that was made here?

Function definitions as reference,

``````ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_t *pos)
{
ssize_t ret;

if (!(file->f_mode & FMODE_WRITE))
if (!file->f_op || (!file->f_op->write && !file->f_op->aio_write))
return -EINVAL;
return -EFAULT;

ret = rw_verify_area(WRITE, file, pos, count);
if (ret >= 0) {
count = ret;
file_start_write(file);
if (file->f_op->write)
ret = file->f_op->write(file, buf, count, pos);
else
ret = do_sync_write(file, buf, count, pos);
if (ret > 0) {
fsnotify_modify(file);
}
inc_syscw(current);
file_end_write(file);
}

return ret;
}

ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos)
{
struct iovec iov = { .iov_base = (void __user *)buf, .iov_len = len };
struct kiocb kiocb;
ssize_t ret;

init_sync_kiocb(&kiocb, filp);
kiocb.ki_pos = *ppos;
kiocb.ki_left = len;
kiocb.ki_nbytes = len;

ret = filp->f_op->aio_write(&kiocb, &iov, 1, kiocb.ki_pos);
if (-EIOCBQUEUED == ret)
ret = wait_on_sync_kiocb(&kiocb);
*ppos = kiocb.ki_pos;
return ret;
}
``````

## Algorithms – Runtime for a given loop confusion

I have a loop:
`for (int i = 0; i <N; i * = 5) {...}`

from where `{...}` is a statement.

I try to understand the term. As far as I know:

So that would be the term $$log_5 (n-1)$$? The reason I'm not sure is that when I was analyzing algorithms, I thought we needed to use basic 2 protocol functions. If the latter is the case, how would I convert? $$log_5$$ to $$log_2$$?