Building a High-Performance Elevation API

This article is reposted from Building a High-Performance Elevation API At ColorfulClouds Technology(彩云科技, “cai yun” in Pinyin for 彩云), we are committed to providing users with meteorological data at higher temporal and spatial resolutions. Over the years, we have consistently faced a challenge: due to limitations in elevation data resolution, outdoor activity enthusiasts, particularly those involved in hiking and cross-country activities, often experience noticeable discrepancies between ColorfulClouds’ data and their actual experiences. This issue is especially prominent in mountainous and plateau regions with dramatic elevation changes. ...

 · 3 min · 1040 words · ringsaturn

Python you let me down

Personally, I’m very disappointed about the some Python community people/projects. It’s been years that PEP 3000(the year was 2006) came up, but we need to wait years until Python 3.11(the year was 2022) to get real performance improvements? Why people keep using Python and spending lots of time to add typing which doesn’t have run time check instead of rewriting codes in Go to get huge speed up while enjoying static language’s safe static type? ...

 · 2 min · 236 words · ringsaturn

Thought on Python's DataFrame

Note ...

 · 2 min · 254 words · ringsaturn

History of package tzf

Introduces the evolution of tzf, from the initial implementation in Go, to the later Python extension, and finally to the current Rust implementation with a PyO3 wrapper.

 · 4 min · 1875 words · ringsaturn

Deploy Hugo pages via GitHub Actions

 · 1 min · 124 words · ringsaturn

Geographic aggregation using the map tile index

When dealing with large amounts of scattered data, sometimes we need to provide a read-only query API to visualize on a map. When the amount of data is too large, say millions, it is not appropriate to return it all to the front end for processing on the browser. Some aggregation should be completed within the back-end service to return the aggregated search to the front end. Here’s how to do this with the MongoDB + tile index in Go. ...

 · 2 min · 369 words · ringsaturn

Computing AQI in Go

I write a package named aqi. Install: 1 go install github.com/ringsaturn/aqi For China’s HJ633-2012 standar: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 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, err := algo.Calc(inputs...) if err != nil { panic(err) } levelDesc, err := algo.AQIToDesc(aqi) if err != nil { panic(err) } fmt.Printf("aqi=%v as level=%v with primary pollutant as %v\n", aqi, levelDesc, primaryPollutant) } Output: ...

 · 1 min · 306 words · ringsaturn

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: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 <script> MathJax = { tex: { inlineMath: [["$", "$"], ["\\(", "\\)"]], displayMath: [["$$", "$$"]], processEscapes: true, processEnvironments: true, tags: "ams", }, options: { skipHtmlTags: [ "script", "noscript", "style", "textarea", "pre", ], }, startup: { ready: () => { MathJax.startup.defaultReady(); // Fix <code> tags after MathJax finishes running const all = MathJax.typesetPromise(); all.then(() => { document.querySelectorAll(".MathJax").forEach( (el) => { el.parentNode.className += " has-jax"; }, ); }); }, }, }; </script> <script id="MathJax-script" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js" ></script> Create extend_head.html: ...

 ·  · 1 min · 177 words · ringsaturn