Finally got access to #chatgpt and got it to write some #javascript for me. A bit to calculate elevation of an aircraft and a bit to calc the normalized inverse square of a radio signal.
I put both bits in a function node in #nodered and plotted the result.
So now I have a radar plot of aircraft distance and signal strength to show changes to my #VHF #VDL2 station.
I could not have written this code, so its a pretty big deal in my books.
@thebaldgeek so you assume it is correct without having verified?

@harx
You raise a great question.
How does someone who cant code or do math 'verify' the results?
I can see the aircraft plotted on a map using code that I did not write, but is open source.
How can I check _that_ code is correct or has been 'verified'?
I checked that code matches the distance code that #chatgpt generated, but is that enough?

msg.intensity = msg.payload.snr / (msg.distance * msg.distance);

msg.nsnr = msg.intensity / (4 * Math.PI);

It wrote these two lines. Are they correct?

@thebaldgeek I mention because from what I've seen ChatGPT is exceptionally good at answers that look correct and fairly poor at correct answers (at least involving code). It is a language model and thus has no concept of correctness so this is expected.

Tests. Sample input with the known expected output, paying particular attention to corner cases, as this is where the model is most likely to break down.

Tests should answer whether the code is accurate without needing to understand the code.

@thebaldgeek @harx
Don't trust in math!!!! Look what I found today: