Computing AQI in Go


I write a package named aqi. Install: go install github.com/ringsaturn/aqi For China’s HJ633-2012 standar: package main import ( "fmt" "github.com/ringsaturn/aqi" "github.com/ringsaturn/aqi/mep" ) func main() { algo := &mep.Algo{} inputs := []*aqi.Var{ { P: aqi.Pollutant_PM2_5_1H, Value: 16, }, { P: aqi.Pollutant_PM10_1H, Value: 88, }, { P: aqi.Pollutant_CO_1H, Value: 0.2, }, { P: aqi.Pollutant_SO2_1H, Value: 3, }, { P: aqi.Pollutant_NO2_1H, Value: 11, }, { P: aqi.Pollutant_O3_1H, Value: 75, }, } aqi, primaryPollutant,…
Read more ⟶

Add Mathjax to Hugo


Code copy&paste from Ataias Pereira Reis’s PR adityatelange/hugo-PaperMod#140 with some modifed on toggle option. Creat two files under layouts/partials/. Create math.html: <script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" > MathJax.Hub.Config({ tex2jax: { inlineMath: [['$', '$'], ['\\(', '\\)']], displayMath: [['$$', '$$']], processEscapes: true, processEnvironments: true, skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'], TeX: { equationNumbers: { autoNumber: "AMS" }, extensions: ["AMSmath.js", "AMSsymbols.js"] } } }); MathJax.Hub.Queue(function () { // Fix <code> tags after MathJax finishes running.…
Read more ⟶