if you are developer and PowerPoint, Google Slides etc. are too much “Klicki bunti”, the framework reveal might be the ideal alternative for you.
Monthly Archives: February 2022
Solar Position Algorithm (SPA) release 0.3.0
The release 0.3.0 of the crate spa is fixing the flaw of the API, and updating to Rust edition 2021.
The SPA can be used to calculate solar position (azimuth and zenith_angle) and the time of sunrise and sunset. This data can be used to optimize the position of solar panels, to optimize load-cycles of energy storages, or to increase or reduce the lighting at home or in vehicles.
As for the flaw in the API: Just implementing unittests, I wasn’t aware that the members of the structure SolarPos lacked the declaration pub. Users of the lib were not able to read the result from return value! Now, after adding example files, these examples are verifying those members are publicly accessible, see below.
// ... pub enum SunriseAndSet { PolarNight, PolarDay, Daylight(DateTime<Utc>, DateTime<Utc>), } // ... pub struct SolarPos { // horizontal angle measured clockwise ... pub azimuth: f64, // the angle between the zenith and the center of the sun's disc pub zenith_angle: f64, }
Moreover the bench tests caused additional complexity due to the required feature handling and conditional builds. For that reason the bench tests have been removed.
In the moment the bench API is getting stabilized any time in future, these bench test will be put back.
Lessons learned: Avoid superfluous complexity and ship with examples always!
Compiler Explorer targeting ARM
I prefer ARM assembly. Adding the following Rust compiler option “–target=aarch64-unknown-linux-gnu”, the output of the Compiler Explorer will be ARM assembly
Another example, analyzing the generated code on ARM64 performing a bit-count, using the instruction CNT from vector unit.