json – In which case are req.params, req.query and req.body used?

I would like to know in which case to use each of them for the creation of an API, I would like to know why I have an API and if I want pages with it and some elements that I only use the req.body, but the others do not know how they would work, I would like to perform a pagination and do two other things with the API for a project. school.

example: to take away by user or by students imagining that each student has more than one project

https:api.com/?user=juan

and if Juan has more than 10, I only take 5 and there are 5 left when he comes back and makes the request, let the 5 others and the first do a findAndUpdate to another condition, example reviewed,

 https:api.com/?user=juan&proj=5

Can you explain the use and how to do it?

remainder – HTTP status code in case of failure of downstream validation

I have an API that bills for an order. It accepts the orderId and the amount as entries. Then, it passes a "/ load" call downstream, which returns a 202. Immediately after this call, it calls a "/ verify" endpoint to make sure that the previous load has succeeded.

Now it can happen that the load has been refused. One reason may be that the user has used an expired card. What should be the error code in this scenario?

From what I see, I can not send 4xx because the request was correct for the perspective of my API. A bad request is something that the user can correct. In this case, it can not correct anything because the API does not accept that the & # 39; orderId & # 39; and the total amount to be billed.

If I send a 5XX, the 500 will have no meaning because it was not an "unexpected condition" on my server. I also can not send a 503 because my server has not been overloaded or stopped for maintenance reasons.

Currently, I am sending you a 503 with an application code mapped to: Payment verification failed.

dnd 5th – Does damage resistance apply to every case of damage or total damage?

You apply resistance to each source of damage

The section "Resistance and Vulnerability" indicates:

Resistance and then vulnerability are applied after all the other modifiers to damage (…)

This tells us that Heavy Armor Master will always apply before any resistance, but we need to know when the modifiers are applied, which is covered in the section "Damages suffered":

Each weapon, spell, and harmful monster ability specifies the damage it inflicts. You roll the die or dice, add any modifier, and apply the damage to your target. Magic weapons, special abilities and other factors can give a bonus to the damage.

However, it still does not tell us clearly if a multi-attack has a significant damage roll or one for each attack, but the "Make an attack" section says this about what happens during an attack:

  1. Solve the attack. You launch the attack. On one stroke, you get damageunless the attack in question has rules specifying the opposite. Some attacks cause special effects in addition to or instead of damage.

An attack deals damage when it hits and with multi-attack, there are several individual moves and so the damage (and thus the resistance) is applied several times.


A quick note: Resistance is also applied as damage type by type of damage, which means that if one thing inflicts several types of damage, you apply a resistance to each one that you resist separately, even if you simply resist it. 39, full damage. This is evoked in the question "Resistance to multiple damage"

Also note that this has no effect on the damage reduction of the Heavy Armor Master, as this only reduces the non-magic damage of the clubbing / piercing / breaking:

When you wear heavy armor, the damage done by non-magic weapons is reduced by 3,

lubuntu – Run the script in case of successful wireless connection

I installed Lubuntu 18.1

I have a simple script to VNC in another PC.

#!/bin/bash

xtightvncviewer 192.168.1.10:5

I want to trigger this script only when the wireless connection is established.

I created this script in my personal folder, then I moved it to /NetworkManager/dispatcher.d with the help of sudo mv -f -i
I then made it executable using chmod +x.

Unfortunately, my script does not run at startup and during a successful login.

Under / network / interfaces, it is indicated: #ifupdown has been replaced by netplan (5) on this system. See / etc / netplan for the current configuration.
Under /netplan/network-manager.yaml, we read: #Let NetworkManager manage all devices on this system.

I do not know why my script does not work on a successful network connection and I do not know how to solve this problem.
I know my script works because if I click on it and run it manually, the VNC works.

Any ideas on where to look for and solve this problem?
Thank you

javascript – how can I cut the code in case the user would say "no" in my confirmation?

I want everything that comes later in my code to be executed only if the user confirms it. In case I say no, I want it to be cut off.

var avanzar = confirm("Esta seguro que desea avanzar?");
    var hachedos = document.querySelector("h2")

if (avanzar==true) {
  hachedos.innerHTML = "Qué alegría que das con tu visita por este maravilloso sitio!!!"

} else {
  hachedos.innerHTML = "Lamentamos que no quieras continuar tu visita por este maravilloso sitio"
};

security – How can I protect my funds in case a quantum computer breaks the PCDLP on which Bitcoin supports it?

An interesting question was posted recently, discussing the idea that hashed addresses are (not significantly) resistant quantum.

As Andrew points out in his answer to this question, paying for a hashed address does not "solve" your pieces, but it is question of using a zero knowledge proof of a BIP32 seed for recover parts safely, against the threat of a quantum computer capable of breaking the problem of discrete log-elliptical curve (ECDLP).

If it is possible, it is clear that more complex constructions for the addresses have advantages (the BIP32 key derivation function being apparently more proof of the quantum, in this case).


So my question is: what constructions of address are known to provide some level of security for a quantum computer defeat the ECDLP? How is this security ensured? How can a user create addresses today, in order to give himself the best chance to see his wealth in Bitcoins survive an extremely powerful quantum computer?

Note that this question aims to explore what a user can do now to mitigate the risk of breaking the "worst case scenario" of ECDLP. with the time needed to plan, there are obviously less scary ways to switch to a quantum algorithm.

SQL Server – Updating Multiple Columns Using the Conditional Case Clause

In the following TSQL code the second column TypeId2 is not updated.
What could be the problem here?

declare @dd table(Id int,number int, TypeId int)
declare @tt table(Id int,TypeId1 int, TypeId2 int)
insert into @dd values(25,10, 1),(25,15, 2)
insert into @tt values(25,0,0)

update t set 
t.TypeId1=case when TypeId=1 then number end,
t.TypeId2=case when TypeId=2 then number end
from @tt t inner join @dd d on d.Id=t.Id

select * from @tt;

After running the code above and selecting the data from @tt I get the following result:

Id  TypeId1 TypeId2
-------------------
25    10      NULL

which is not acceptable because the value of TypeId2 is zero, it should be 15.

c # – color checking unit in case of collision Enter2d

I'm trying to understand how to check the color of my 2d collision sprite.
I change my sprite colors like this:

Color newColor = new Color(0.68f, 0.63f, 0.76f);
                    m_spriteRenderer.color = newColor;

and on the other script I have OnCollision2d function:

private void OnCollisionEnter2D(Collision2D col)
    {
        Destroy(col.gameObject);
    }

Depending on the color, I want to remove the sprite or just add points.

thank you,

seo – How is the density of keywords calculated in this case?

Example:

I have the keyword:

"how to download Advanced Systemcare 6.3"

And I'm using the advanced query "advanced systemcare 6.3" in my text;

Does it count 3 times ("advanced", "advanced systemcare", "advanced systemcare 6.3") or 1 ("advanced systemcare 6.3")?

I have this silly question when it comes to counting the keyword density 🙁

Rear focus with Canon 7D2 case and Sigma 50mm lens: Is the Sigma USB cradle the answer?

I just bought a used Sigma lens (50mm Art f / 1.4) for my Canon 7D2 (Mark II) case. This combination creates a very serious problem of gravity:

  • Without correction of micro-adjustments on my body, the aircraft in focus is about half an inch farther from the one I target with the viewfinder: for a portrait of someone located a few meters away, when you focus on the eye, the focused area is somewhere between the eye and the ear.
  • With the maximum correction of micro-adjustments in my body (-20 of -20 / + 20 range), the problem of the rear focus is attenuated, but still there. I imagine that -25 or -30 could have solved this problem, but it is not available.
  • when you use Liveview to focus, everything is fine.

I used f / 1.4 while trying to calibrate micro-adjustments.

Do you think using the Sigma USB Access Station to adjust the focus setting of the lens would solve this problem? Do I have to resell it and buy another copy?