I think the appRoute macro obfuscates the types and signatures, and introduces some unnecessary indirection. I would get rid of it.
Related, the AppContext type could be renamed RequestContext or ControllerContext or something as its App + HTTP Request + DB and not just the App.
Otherwise, I agree with other commenters that this is some of the cleanest C code I’ve seen in a while! Great effort!
Chips being cheap makes sense at the lithography / wafer level because sure, you can stamp out thousands of them at once. But once you need to dice them up, bond wires to them, and package them... how on earth do you do that so efficiently that each chip can be sold for fractions of a cent?
So, to calibrate a sleep tracking device, you have a person wear the device, while also doing the sleep study. You do this a bunch of times. You train some ML models to try and make the outputs from the sensor data, after processing, the same as the study data.
After some degree of accuracy you declare success.
Now, does it work? In broad strokes, yes. You can (easily!!) see the effect of alcohol on sleep quality. If you have a crap night vs a good night, sure, a wrist based consumer device can figure that out.
Actual details? Eh. I wouldn't trust the devices for anything but directional data.
The more sensors devices get, the better than ML model can be trained.
Now it has been awhile since I last worked on this stuff (I actually just sat next to the people doing the work), so maybe there is some revolutionary new technique out there, but if not, it is still ML models trying to correlate things and match them up to what a bunch of fancier sensors said during studies.
I have very little wrist pain any more.
I also have a kinesis pro keyboard and a MX master mouse. They both add to the improvement.
I’ve found that when you’re going from (weak, sedentary) => (strong, active) it can sometimes be difficult to discern what activities are good or bad for your pain. Sometimes you need to work through pain to find relief and strength on the other side, but sometimes working through pain just leads to more pain. The boundaries aren’t always clear at the time.
Also, for what it's worth, it's hard to imagine a better executor than Christopher Tolkien. He basically spent his entire life serving his father's artistic interests.
These software giants never take a responsibility of wrongful automated result for decades but we keep using it.
Meta doesn't have an incentive to fix this case. It costs them manual labor of many manhours that outweigh the ad revenue from this person.
It probably keep this way.