Javascript – I have a problem with form of credit calculations

I am trying to do the following calculation:

The user enters his salary.
The system calculates a 30% credit on your salary.
The system grants you 30% of your salary plus 33% interest.

Example: If I have a salary of $ 1000, the system grants me $ 300 credit and I have to pay a total of $ 399 because $ 99 is interest, which is 33%.

Take an example of code but I don't know how to customize it and it just shows me the interests on the form. I also commented on the click element as there is no need to click, but neither does it show me the results and I don't know how to fix it.

Thank you

let importeSueldo = document.getElementById("importeSueldo")
let inporteOtorgado = document.getElementById("inporteOtorgado")
let importeDevolucion = document.getElementById("importeDevolucion")
    
inporteOtorgado.forEach((elemento) => {
 // elemento.addEventListener("click", () => {
    if (importeSueldo.value == "") {
    	console.log("Falta el valor de tu inversión")
    } else {
      let calculoUno = importeSueldo.value * elemento.value / 100
	  let calculoFinal = Number(importeSueldo.value) + Number(calculoUno)
	  importeDevolucion.value = calculoFinal
    }
  //})
})
Mi sueldo:

Te otorgamos (30%):

A devolver en un pago (33%):

Off camera flash – problem with locking synchronization with Godox X2T-N and Nikon D5100

I just bought a Godox X2T-N transmitter for my Nikon D5100 along with a Godox TT600 Speedlite.

When I played with it, I noticed that the pictures were cut horizontally in half, with the upper part being more illuminated than the lower one. At first I thought it was a camera problem, but after a few checks I finally found that it was a synchronization problem: there is latency between the flash and the shutter.

Setup is as simple as possible with these three elements: the transmitter is attached to the hot shoe of the camera, the flash is set as slave (S1) in group A, channel 1.

The camera shutter speed is set to 1/200 (in manual mode) (this seems to be the fastest shutter speed allowed when the transmitter is mounted) and the anti-red-eye feature is disabled. The trigger is set to high speed synchronization (although I noticed this for the first time in synchronization mode of the second curtain) – Edit: Apparently the D5100 is not HSS-capable (high speed synchronization), so this is expected. The camera exposure delay mode doesn't improve things, nor does the X2T delay setting.

I've seen the Godox download page update for "The problem is that when the shutter is set to high speed sync and continuous shooting in 1Dx and 1DxII cameras, the shutter sometimes returns to low speed"Could this be a similar problem with the Canon version of the transmitter?

Before trying to contact Godox, I wanted to know if there were any other settings that I might be able to check to fix this delay, or if there was a workaround besides reducing the shutter speed.

Complexity Theory – Isn't Every Polynomial Time Problem an NP Problem?

Look here. Backpack problem – NP-complete despite dynamic programming solution?

The only reason why the backpack problem is NP-complete is because the input is made as binary numbers, so n is actually 2 ^ n. Because the weight is an axis of the DP array.

Then for every single problem, for example one that requires an O (n) loop through an O (n) sized array, if we actually consider the array to be 2 ^ n bits long or something in the direction of this effect that actually Doesn't it make sense, aren't all of these problems actually NP-complete?

It seems to me that the original "feeling / intuition" of relatively mediocre test cases for NP problems that don't even work is rejected, because then almost every algorithm will ever be NP.

Probability distributions – problem of variation: How can the second moment be minimized?

This is a clearer version of a question I've posted here and I'm sticking to.

The problem: Suppose I have a probability density function $ f (x) $, defined as positive $ x $and let's write his down $ n $The non-centered moment $ x_ {n} $. Now if the mean $ x_ {1} $ is fixed what $ f (x) $ minimizes the second moment $ x_ {2} $? My intuition says that it should be an exponential distribution (or a similar form).

My attempt: I want to minimize functionality

$ J (y) = int x ^ {2} f (x) dx $

with the limitations of mean and unit integral:

$ int xf (x) dx = x_ {1} $

$ int f (x) dx = 1 $

So I have to minimize the modified function:

$ J ^ { ast} (y) = int x ^ {2} f (x) dx + alpha int xf (x) dx + beta int f (x) dx $

$ J ^ { ast} (y) = int (x ^ {2} f (x) + alpha xf (x) + beta f (x)) dx $

$ J ^ { ast} (y) = int (x ^ {2} + alpha x + beta) f (x) dx $

Applying Euler-Lagrange results in $ x ^ {2} + alpha x + beta = 0 $, Where $ f (x) $ does not appear!

So I don't know how to do it, especially to find the values ​​of $ alpha $ and $ beta $.
I also tried adding a positivity limitation $ f (x) $by replacing with $ u (x) ^ {2} $ (always positive by design), but leads to the same Euler-Lagrange equation.

Could someone help me with this? Many thanks!

Problem with the rear LED display of the Nikon D3400

I was outside in the middle of a relatively bright, sunny day and had just taken 10 to 20 shots with the viewfinder. The camera worked perfectly and showed me the pictures on the reading display immediately after the picture and showed me information on the rear display My settings, the menu items are shown when I press the menu button, etc. 5 minutes later, however, I press the menu button to select one Change setting and nothing appears on the rear display. I press the button to view previously taken pictures, nothing appears. I press the info button, nothing is displayed. I press the I Button is not displayed. I couldn't see anything on the rear LCD display. And not because the sun was too bright to see the display. However, I could easily look through the viewfinder and see my settings, frame a picture and take pictures. Totally stunned. Later, at home in the house, I turn on the camera and press the buttons mentioned above. I have no problem getting things on the rear LCD display. Has anyone done this with the Nikon D3400 or similar and has any idea what could have happened? it hasn't happened since then and i don't remember it ever happened before.

Javascript – problem with loop while and foreach (PHP & JS)

I have two values ​​from two different columns in the database: column: length, length. I saved values ​​in every column of the table: position. I want to list all values ​​of latitude and logintude. To view this geolocation, I have to use Javascript. So I created JS variables to save PHP data in Javascript. Now I don't know how to loop and display all values. The way I tried only returns one row in the column: Latitude and Longintude. I want to return all lines.





If anyone can help me, I would appreciate it!