Re:Ask HN: Tools you have made for yourself?
by themantri on Sunday June 13, 2021 @11:20AM
(#27493326)
Could you please explain more about how the Decoder ring works? And how it's data is maintained?
Thanks for sharing!
Re:Ask HN: Tools you have made for yourself?
by modeless on Monday June 14, 2021 @12:10AM
(#27499220)
It's all client side. The entire database of error messages is downloaded up front and searched in JavaScript. The database is just a JSON file that I put together with some scripts to parse a few header files and other documentation. The whole thing is fewer bytes than a typical news article page these days, so why not download it all up front? I wish more sites worked this way.
I was a bit frustrated always pasting error codes into Google, as it doesn't always come up with the best result. You often have to extract just the code from a larger message, and potentially convert to/from hex or signed/unsigned, e.g. Windows error codes like "-2005270521". My tool handles all that for you. Just paste an error message containing codes in whatever format and it'll find them, and it's incredibly fast.
I also made https://aqi.today during the California wildfires. I was frustrated by other air quality sites that load way too slowly and don't emphasize the one number that matters. Airnow.gov has improved since I made this, but but I still prefer mine for the simplicity, speed, and much better data sourced from Purpleair. Airnow.gov sensors are typically 5+ miles apart, and data is delayed by an hour or more, while air quality can vary on a block-to-block and minute-to-minute basis. Purpleair has far better sensor coverage and data is delayed only 10-20 minutes.